Pārlūkot izejas kodu

【会员系统】提示语弹出两次问题

dinglingui 1 nedēļu atpakaļ
vecāks
revīzija
bb601333d6

+ 1 - 1
PDF Office/PDF Master/Class/Purchase/DMG/Verification/KMVerificationMessageViewController.m

@@ -414,7 +414,7 @@ NSPopoverDelegate>
             }
         }
         
-        CGFloat buttonWidth = CGRectGetMaxX(self.button.frame);
+        buttonWidth = CGRectGetMaxX(self.button.frame);
         NSRect btnRect = [self.button.attributedTitle boundingRectWithSize:CGSizeMake(MAXFLOAT, CGRectGetHeight(self.button.frame)) options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading];
         if (fabs(buttonWidth-btnRect.size.width)>50) {
             buttonWidth = btnRect.size.width + 10;

+ 2 - 9
PDF Office/PDF Master/MemberCenter/ViewModel/KMSignUpViewModel.swift

@@ -295,7 +295,7 @@ class KMSignUpViewModel: ObservableObject {
                 
                 self.timer?.cancel()
                 self.sendContent = NSLocalizedString("Resend", tableName: "MemberCenterLocalizable", comment: "")
-
+                
                 KMMemberInfo.shared.avatarImage = nil
             } else {
                 if(resultDict.code == 305) {
@@ -326,19 +326,12 @@ class KMSignUpViewModel: ObservableObject {
                     }
                 } else {
                     callback?(false)
-                    
                     print("错误信息:%@", msg as Any)
-                    DispatchQueue.main.async {
-                        let alert = NSAlert()
-                        alert.messageText = NSLocalizedString(msg!, comment: "")
-                        alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
-                        let response = alert.runModal()
+                    KMMemberCenterManager.showAlert(code: .init(rawValue: resultDict.code), message: resultDict.msg) { response, _ in
                         if response == .alertFirstButtonReturn {
                             if(resultDict.code == 317) {
                                 self.signUpState = .verificationCode
                                 self.countDown(type: .login, callback: nil)
-                            } else {
-                                KMMemberCenterManager.showAlert(code: .init(rawValue: resultDict.code), message: resultDict.msg, callback: nil)
                             }
                         }
                     }