diff --git a/lib/login/login_page.dart b/lib/login/login_page.dart index 280d79fb..d4c9503a 100644 --- a/lib/login/login_page.dart +++ b/lib/login/login_page.dart @@ -68,8 +68,7 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { sharedPreferences.getString("token") != null && sharedPreferences.getString("token") != "") { Navigator.of(context).popAndPushNamed('/router/main_page'); - } else { - initController(); + } else {initController(); client = ApiService(Dio(), context: context); isShowLogin = true; @@ -301,8 +300,8 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { print(error); SmartDialog.showToast("$error", alignment: Alignment.center); }); - Future.delayed(Duration(seconds: 2), () { - EasyLoading.dismiss(); + EasyLoading.show(status: S.of(context).zhengzaijiazai); + Future.delayed(Duration(seconds:2), () { if (value !=null && value.isSuccess) { saveUserJson(value.data); eventBus.fire(EventType(3)); @@ -311,6 +310,8 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { '/router/main_page', (route) => false, ); + EasyLoading.dismiss(); + } else { SmartDialog.showToast("${value.msg}", alignment: Alignment.center); }