戴余标 2 years ago
commit 6eaba0d1c3

@ -52,8 +52,8 @@ class UserProvider extends ChangeNotifier {
_isLogin = true;
//app
await updateUserInfo();
// await updateConSms();
// await updateRefSms();
await updateConSms();
await updateRefSms();
}
Future logout() async {

@ -42,7 +42,7 @@ class _LoginPageState extends State<LoginPage> {
late FocusNode _phoneFocusNode ;
late FocusNode _smsCodeFocusNode;
bool _cantSelected = false;
DateTime? _lastTap;
@override
void initState() {
super.initState();
@ -129,6 +129,11 @@ class _LoginPageState extends State<LoginPage> {
}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<LoginPage> {
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: "立即登录",

Loading…
Cancel
Save