comments for login test, will revert to real token login soon.
Signed-off-by: chaoq <chaoq@gxtech.ltd>
This commit is contained in:
@@ -43,13 +43,13 @@ class LoginViewModel : ViewModel() {
|
|||||||
|
|
||||||
fun login(onLoginSuccess: () -> Unit) {
|
fun login(onLoginSuccess: () -> Unit) {
|
||||||
if (phoneNumber.isEmpty() || !isValidPhoneNumber(phoneNumber)) {
|
if (phoneNumber.isEmpty() || !isValidPhoneNumber(phoneNumber)) {
|
||||||
errorMessage = "请输入有效的手机号"
|
//errorMessage = "请输入有效的手机号"
|
||||||
return
|
//return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (verificationCode.isEmpty() || verificationCode.length != 6) {
|
if (verificationCode.isEmpty() || verificationCode.length != 6) {
|
||||||
errorMessage = "请输入6位验证码"
|
//errorMessage = "请输入6位验证码"
|
||||||
return
|
//return
|
||||||
}
|
}
|
||||||
|
|
||||||
isLoading = true
|
isLoading = true
|
||||||
@@ -59,7 +59,7 @@ class LoginViewModel : ViewModel() {
|
|||||||
delay(1500)
|
delay(1500)
|
||||||
|
|
||||||
// TODO: Implement actual Firebase verification
|
// TODO: Implement actual Firebase verification
|
||||||
if (verificationCode == "123456") { // Mock verification
|
if (verificationCode == "") { // Mock verification
|
||||||
errorMessage = null
|
errorMessage = null
|
||||||
onLoginSuccess()
|
onLoginSuccess()
|
||||||
} else {
|
} else {
|
||||||
@@ -84,7 +84,8 @@ class LoginViewModel : ViewModel() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun isValidPhoneNumber(phone: String): Boolean {
|
private fun isValidPhoneNumber(phone: String): Boolean {
|
||||||
return phone.matches(Regex("^1[3-9]\\d{9}$"))
|
//return phone.matches(Regex("^1[3-9]\\d{9}$"))
|
||||||
|
return true // Mock verification
|
||||||
}
|
}
|
||||||
|
|
||||||
fun clearError() {
|
fun clearError() {
|
||||||
|
|||||||
Reference in New Issue
Block a user