diff --git a/lib/controller/mine/deactivate_controller.dart b/lib/controller/mine/deactivate_controller.dart index 9c0a7de..6dc6361 100644 --- a/lib/controller/mine/deactivate_controller.dart +++ b/lib/controller/mine/deactivate_controller.dart @@ -36,7 +36,9 @@ class DeactivateController extends GetxController { } // 先退出 IM 登录 - await IMManager.instance.logout(); + if(IMManager.instance.isInitialized){ + await IMManager.instance.logout(); + } // 清除会话列表和用户信息缓存 if (Get.isRegistered()) { final conversationController = Get.find(); diff --git a/lib/controller/setting/setting_controller.dart b/lib/controller/setting/setting_controller.dart index 32b71af..5a175cb 100644 --- a/lib/controller/setting/setting_controller.dart +++ b/lib/controller/setting/setting_controller.dart @@ -83,7 +83,9 @@ class SettingController extends GetxController { } // 先退出 IM 登录 - await IMManager.instance.logout(); + if(IMManager.instance.isInitialized){ + await IMManager.instance.logout(); + } // 清除会话列表和用户信息缓存 if (Get.isRegistered()) { final conversationController = Get.find(); diff --git a/lib/network/network_config.dart b/lib/network/network_config.dart index b2a14cf..079b1a7 100644 --- a/lib/network/network_config.dart +++ b/lib/network/network_config.dart @@ -182,8 +182,10 @@ class ResponseInterceptor extends Interceptor { print('取消小窗口失败: $e'); } } - - await IMManager.instance.logout(); + + if(IMManager.instance.isInitialized){ + await IMManager.instance.logout(); + } // 清除会话列表和用户信息缓存 if (Get.isRegistered()) { final conversationController = Get.find(); diff --git a/lib/pages/mine/auth_center_page.dart b/lib/pages/mine/auth_center_page.dart index 151731c..d07935c 100644 --- a/lib/pages/mine/auth_center_page.dart +++ b/lib/pages/mine/auth_center_page.dart @@ -104,9 +104,6 @@ class AuthCenterPage extends StatelessWidget { ), ).onTap(() async{ if(item.index == 1) { - if(item.authed){ - return; - } await Get.to(() => PhonePage()); } else if(item.index == 2){ await Get.to(() => EditInfoPage()); diff --git a/lib/pages/mine/phone_page.dart b/lib/pages/mine/phone_page.dart index 117c3fa..cce7aec 100644 --- a/lib/pages/mine/phone_page.dart +++ b/lib/pages/mine/phone_page.dart @@ -29,25 +29,25 @@ class PhonePage extends StatelessWidget { const SizedBox(height: 12), Text(_encryptPhone(controller.phone.value), style: TextStyle(fontSize: 40, fontWeight: FontWeight.bold)), SizedBox(height: 64), - TDButton( - text: '更换手机号码', - width: MediaQuery.of(context).size.width - 50, - size: TDButtonSize.large, - type: TDButtonType.fill, - shape: TDButtonShape.round, - style: TDButtonStyle( - textColor: Colors.white, - backgroundColor: Color(0xFF7562F9), - ), - activeStyle: TDButtonStyle( - textColor: Colors.white, - backgroundColor: Color(0xC37562F9), - ), - onTap: (){ - controller.tabIndex.value = 1; - }, - ), - SizedBox(height: 200), + // TDButton( + // text: '更换手机号码', + // width: MediaQuery.of(context).size.width - 50, + // size: TDButtonSize.large, + // type: TDButtonType.fill, + // shape: TDButtonShape.round, + // style: TDButtonStyle( + // textColor: Colors.white, + // backgroundColor: Color(0xFF7562F9), + // ), + // activeStyle: TDButtonStyle( + // textColor: Colors.white, + // backgroundColor: Color(0xC37562F9), + // ), + // onTap: (){ + // controller.tabIndex.value = 1; + // }, + // ), + // SizedBox(height: 200), ], ), ),