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