소스 검색

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

tangchao 6 일 전
부모
커밋
7fbc0216c1
1개의 변경된 파일14개의 추가작업 그리고 0개의 파일을 삭제
  1. 14 0
      PDF Office/PDF Master/MemberCenter/ViewModel/KMSignUpViewModel.swift

+ 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: "")