戴余标 2 years ago
commit 6eaba0d1c3

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

@ -42,7 +42,7 @@ class _LoginPageState extends State<LoginPage> {
late FocusNode _phoneFocusNode ; late FocusNode _phoneFocusNode ;
late FocusNode _smsCodeFocusNode; late FocusNode _smsCodeFocusNode;
bool _cantSelected = false; bool _cantSelected = false;
DateTime? _lastTap;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -129,6 +129,11 @@ class _LoginPageState extends State<LoginPage> {
}else if(!_chooseAgreement){ }else if(!_chooseAgreement){
BotToast.showText(text: "请同意并勾选隐私政策"); BotToast.showText(text: "请同意并勾选隐私政策");
}else{ }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, var base = await apiClient.request(API.app.login,
data: {'phone': _phoneController.text, 'code': _smsCodeController.text}); data: {'phone': _phoneController.text, 'code': _smsCodeController.text});
if (base.code == 0) { if (base.code == 0) {
@ -137,16 +142,9 @@ class _LoginPageState extends State<LoginPage> {
Get.offAll(const TabNavigator()); Get.offAll(const TabNavigator());
} }
else { else {
CloudToast.show(base.msg);
}
// if(_lastTap != null && DateTime.now().difference(_lastTap!).inSeconds < 2){
// BotToast.showText(text: "点太快");
// return;
// }
// _lastTap = DateTime.now();
} }
}
}, },
text: "立即登录", text: "立即登录",

Loading…
Cancel
Save