Переглянути джерело

【fix】【登录】AppStore-免费版,登录页面当email和验证码都为空时,点击登录,提示文案错误(如果都为空,需要提示提示错误)

tangchao 6 днів тому
батько
коміт
7fbc0216c1

+ 14 - 0
PDF Office/PDF Master/MemberCenter/ViewModel/KMSignUpViewModel.swift

@@ -210,6 +210,13 @@ class KMSignUpViewModel: ObservableObject {
             callback?(nil)
             return
         }
+        if email.isEmpty {
+            emailErrorMessage = NSLocalizedString("Please enter email address", tableName: "MemberCenterLocalizable", comment: "")
+            
+            callback?(nil)
+            return
+        }
+        
         if email.count <= 0 || email.count > 100 || !isValidEmail() {
             emailErrorMessage = NSLocalizedString("Email format error. Please enter the correct email.", tableName: "MemberCenterLocalizable", comment: "")
             
@@ -219,6 +226,13 @@ class KMSignUpViewModel: ObservableObject {
         
         var code: String = ""
         if signUpState == .verificationCode {
+            if verificationCode.isEmpty {
+                passwordErrorMessage = NSLocalizedString("Please enter code", tableName: "MemberCenterLocalizable", comment: "")
+                
+                callback?(nil)
+                return
+            }
+            
             if verificationCode.count <= 0 || verificationCode.count > 6 || !isValidVerificationCode() {
                 passwordErrorMessage = NSLocalizedString("Verification code error.", tableName: "MemberCenterLocalizable", comment: "")