From 04f197d912a9ad51f7edce11fa515293b651df30 Mon Sep 17 00:00:00 2001 From: wylyl22 <2373073266@qq.com> Date: Fri, 26 Aug 2022 08:27:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BB=B7=E6=9B=B4=E6=94=B9?= 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 | 31 +++++++++++++++++----------- lib/ui/user/privacy_rights_page.dart | 2 +- 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/lib/providers/user_provider.dart b/lib/providers/user_provider.dart index 071d523..a8cbc80 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(); + updateConSms(); + updateRefSms(); } Future logout() async { diff --git a/lib/ui/login/login_page.dart b/lib/ui/login/login_page.dart index 669db37..06bde89 100644 --- a/lib/ui/login/login_page.dart +++ b/lib/ui/login/login_page.dart @@ -133,17 +133,19 @@ class _LoginPageState extends State { 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) { - print("123123${base.data['token']}"); - await UserTool.userProvider.setToken(base.data['token']); - Get.offAll(const TabNavigator()); - } - else { - - } + _lastTap = DateTime.now(); + var base = await apiClient.request(API.app.login, + data: {'phone': _phoneController.text, 'code': _smsCodeController.text}); + if (base.code == 0) { + print("123123${base.data['token']}"); + var a= await UserTool.userProvider.setToken(base.data['token']); + print(a); + print("4567899"); + Get.offAll(const TabNavigator()); + } + else { + CloudToast.show(base.msg); + } } }, @@ -220,7 +222,12 @@ class _LoginPageState extends State { await apiClient.request(API.app.captcha, data: { 'phone': _phoneController.text, }); - _beginCountDown(); + if((_phoneController.text).isEmpty ){ + BotToast.showText(text: "手机号不能为空"); + }else{ + _beginCountDown(); + } + if (_cantSelected) return; _cantSelected = true; Future.delayed(const Duration(seconds: 1), () { diff --git a/lib/ui/user/privacy_rights_page.dart b/lib/ui/user/privacy_rights_page.dart index 5531e1a..d4a8fbd 100644 --- a/lib/ui/user/privacy_rights_page.dart +++ b/lib/ui/user/privacy_rights_page.dart @@ -16,7 +16,7 @@ class PrivacyRightsPage extends StatefulWidget { @override _PrivacyRightsPageState createState() => _PrivacyRightsPageState(); } -final Uri _url = Uri.parse('https://www.dxbs.vip/explain.html'); +final Uri _url = Uri.parse('https://www.dxbs.vip//explain.html'); // final Telephony telephony = Telephony.instance; // late final bool permissionsGranted; // String body = "";