comments for login test, will revert to real token login soon.

Signed-off-by: chaoq <chaoq@gxtech.ltd>
This commit is contained in:
2025-09-17 22:58:53 +08:00
parent 3bdc40df94
commit 9eb3cb6f6b

View File

@@ -43,13 +43,13 @@ class LoginViewModel : ViewModel() {
fun login(onLoginSuccess: () -> Unit) {
if (phoneNumber.isEmpty() || !isValidPhoneNumber(phoneNumber)) {
errorMessage = "请输入有效的手机号"
return
//errorMessage = "请输入有效的手机号"
//return
}
if (verificationCode.isEmpty() || verificationCode.length != 6) {
errorMessage = "请输入6位验证码"
return
//errorMessage = "请输入6位验证码"
//return
}
isLoading = true
@@ -59,7 +59,7 @@ class LoginViewModel : ViewModel() {
delay(1500)
// TODO: Implement actual Firebase verification
if (verificationCode == "123456") { // Mock verification
if (verificationCode == "") { // Mock verification
errorMessage = null
onLoginSuccess()
} else {
@@ -84,7 +84,8 @@ class LoginViewModel : ViewModel() {
}
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() {