From f79196bbf116b0957549720604a741e9eaaf1aaf Mon Sep 17 00:00:00 2001 From: wylyl22 <2373073266@qq.com> Date: Thu, 25 Aug 2022 17:48:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/providers/user_provider.dart | 4 ++-- lib/ui/login/login_page.dart | 16 +++++++--------- 2 files changed, 9 insertions(+), 11 deletions(-) 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: "立即登录",