|
|
|
@ -256,8 +256,13 @@ class LoginController extends GetxController { |
|
|
|
_countdownSeconds.value = 0; |
|
|
|
} |
|
|
|
|
|
|
|
void _syncContactLoginType() { |
|
|
|
loginType = _selectedCountryCode.value.isEmpty ? 0 : 1; |
|
|
|
} |
|
|
|
|
|
|
|
// 获取验证码 |
|
|
|
void getVerificationCode() { |
|
|
|
_syncContactLoginType(); |
|
|
|
if (contactController.text.isEmpty) { |
|
|
|
Get.snackbar( |
|
|
|
'tip'.tr, //提示 |
|
|
|
@ -311,6 +316,7 @@ class LoginController extends GetxController { |
|
|
|
|
|
|
|
// 切换到验证码页面 |
|
|
|
void showVerificationView() { |
|
|
|
_syncContactLoginType(); |
|
|
|
if (contactController.text.isEmpty) { |
|
|
|
Get.snackbar( |
|
|
|
'tip'.tr, |
|
|
|
@ -402,6 +408,7 @@ class LoginController extends GetxController { |
|
|
|
|
|
|
|
// 重新发送验证码 |
|
|
|
void resendVerificationCode() { |
|
|
|
_syncContactLoginType(); |
|
|
|
if (_countdownSeconds.value > 0) return; |
|
|
|
_startCountdown(); |
|
|
|
_sendVerificationCode(); |
|
|
|
@ -467,7 +474,10 @@ class LoginController extends GetxController { |
|
|
|
} |
|
|
|
|
|
|
|
// 登录 |
|
|
|
Future<void> login() async { |
|
|
|
Future<void> login({bool fromSocial = false}) async { |
|
|
|
if (!fromSocial) { |
|
|
|
_syncContactLoginType(); |
|
|
|
} |
|
|
|
// 添加基础验证 |
|
|
|
if (loginType == 0 || loginType == 1) { |
|
|
|
// 邮箱或手机号登录 |
|
|
|
|