Browse Source

首页登陆优化

ff_new
w-R 3 years ago
parent
commit
4fd5ecda7e
  1. 9
      lib/login/login_page.dart

9
lib/login/login_page.dart

@ -68,8 +68,7 @@ class _MyLoginPageState extends State<LoginPage> 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<LoginPage> 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<LoginPage> with TickerProviderStateMixin {
'/router/main_page',
(route) => false,
);
EasyLoading.dismiss();
} else {
SmartDialog.showToast("${value.msg}", alignment: Alignment.center);
}

Loading…
Cancel
Save