diff --git a/lib/providers/user_provider.dart b/lib/providers/user_provider.dart index fe62bf8..071d523 100644 --- a/lib/providers/user_provider.dart +++ b/lib/providers/user_provider.dart @@ -52,8 +52,8 @@ class UserProvider extends ChangeNotifier { _isLogin = true; //每次打开app更新用户信息 await updateUserInfo(); - // await updateConSms(); - // await updateRefSms(); + await updateConSms(); + await updateRefSms(); } Future logout() async { diff --git a/lib/ui/login/login_page.dart b/lib/ui/login/login_page.dart index 8129962..669db37 100644 --- a/lib/ui/login/login_page.dart +++ b/lib/ui/login/login_page.dart @@ -42,7 +42,7 @@ class _LoginPageState extends State { late FocusNode _phoneFocusNode ; late FocusNode _smsCodeFocusNode; bool _cantSelected = false; - + DateTime? _lastTap; @override void initState() { super.initState(); @@ -129,6 +129,11 @@ class _LoginPageState extends State { }else if(!_chooseAgreement){ BotToast.showText(text: "请同意并勾选隐私政策"); }else{ + if(_lastTap != null &&DateTime.now().difference(_lastTap!).inSeconds < 2){ + BotToast.showText(text: "过快"); + return ; + } + _lastTap = DateTime.now(); var base = await apiClient.request(API.app.login, data: {'phone': _phoneController.text, 'code': _smsCodeController.text}); if (base.code == 0) { @@ -137,16 +142,9 @@ class _LoginPageState extends State { Get.offAll(const TabNavigator()); } else { - CloudToast.show(base.msg); - } - // if(_lastTap != null && DateTime.now().difference(_lastTap!).inSeconds < 2){ - // BotToast.showText(text: "点太快"); - // return; - // } - // _lastTap = DateTime.now(); } - + } }, text: "立即登录",