diff --git a/lib/constants/saas_api.dart b/lib/constants/saas_api.dart index da3b5699..2c94f68f 100644 --- a/lib/constants/saas_api.dart +++ b/lib/constants/saas_api.dart @@ -104,7 +104,10 @@ class _User { class _Login { ///app用户退出 - String get logOut => '/app/user/quit'; + String get quit => '/app/user/quit'; + + ///app用户注销 + String get logOut =>'/app/user/logout'; ///查询所有小区信息 String get allCommunity => '/app/login/findAllCommunity'; diff --git a/lib/pages/setting_page/account_manager_page.dart b/lib/pages/setting_page/account_manager_page.dart index a0376265..8840ad16 100644 --- a/lib/pages/setting_page/account_manager_page.dart +++ b/lib/pages/setting_page/account_manager_page.dart @@ -1,3 +1,4 @@ +import 'package:aku_new_community/constants/saas_api.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -7,6 +8,9 @@ import 'package:velocity_x/velocity_x.dart'; import 'package:aku_new_community/pages/sign/login/other_login_page.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; +import '../../utils/network/base_model.dart'; +import '../../utils/network/net_util.dart'; + class AccountManagerPage extends StatefulWidget { AccountManagerPage({Key? key}) : super(key: key); @@ -37,9 +41,12 @@ class _AccountManagerPageState extends State { color: Colors.red.withOpacity(0.7), ), ), - onPressed: () { - //暂时隐去一键登录页 - Get.offAll(() => OtherLoginPage()); + onPressed: () async { + BaseModel baseModel = + await NetUtil().post(SAASAPI.login.logOut); + if (baseModel.success) { + Get.offAll(() => OtherLoginPage()); + } }, ), ], diff --git a/lib/pages/setting_page/settings_page.dart b/lib/pages/setting_page/settings_page.dart index b3294cf7..28973073 100644 --- a/lib/pages/setting_page/settings_page.dart +++ b/lib/pages/setting_page/settings_page.dart @@ -143,10 +143,10 @@ class _SettingsPageState extends State { title: '意见反馈', onTap: () => Get.to(() => FeedBackPage()), ), - // _buildTile( - // title: '账号管理', - // onTap: () => Get.to(() => AccountManagerPage()), - // ), + _buildTile( + title: '账号管理', + onTap: () => Get.to(() => AccountManagerPage()), + ), _buildTile( title: '用户协议', onTap: () => Get.to(() => AgreementPage()), diff --git a/lib/provider/user_provider.dart b/lib/provider/user_provider.dart index 0ac877d5..402c8bd5 100644 --- a/lib/provider/user_provider.dart +++ b/lib/provider/user_provider.dart @@ -58,7 +58,7 @@ class UserProvider extends ChangeNotifier { final appProvider = Provider.of(Get.context!, listen: false); appProvider.setCurrentHouse(null); if (_isLogin) { - NetUtil().post(SAASAPI.login.logOut, showMessage: true); + NetUtil().post(SAASAPI.login.quit, showMessage: true); NetUtil().dio!.options.headers.remove('app-login-token'); _isLogin = false; }