Ver Fonte

【fix】【注销】DMG,走完注销流程后-撤回注销,再次进入注销页面,还会记住上次注销输入的验证码

tangchao há 3 meses atrás
pai
commit
240b692bea

+ 1 - 0
PDF Office/PDF Master/Class/Purchase/DMG/KMPurchaseEmbeddedWindowController.swift

@@ -230,6 +230,7 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
         } else {
             let configWC: KMPurchaseEmbeddedWindowController = KMPurchaseEmbeddedWindowController.init(windowNibName: "KMPurchaseEmbeddedWindowController")
             currentWindowController = configWC;
+            _ = configWC.window
             currentWindowController.product_code = productCode
             return currentWindowController
         }

+ 10 - 0
PDF Office/PDF Master/MemberCenter/WindowsController/KMCloseVerificationWC.swift

@@ -45,6 +45,8 @@ class KMCloseVerificationWC: NSWindowController {
         
         nextButton.isEnabled = false
         
+        window?.delegate = self
+        
         NotificationCenter.default.addObserver(self, selector: #selector(changeEffectiveAppearance), name: NSNotification.Name(rawValue: "kEffectiveAppearance"), object: nil)
     }
     
@@ -210,3 +212,11 @@ extension KMCloseVerificationWC: NSTextFieldDelegate {
         }
     }
 }
+
+extension KMCloseVerificationWC: NSWindowDelegate {
+    func windowWillClose(_ notification: Notification) {
+        if let data = self.window?.isEqual(to: notification.object), data {
+            verifficationTextField.stringValue = ""
+        }
+    }
+}