Prechádzať zdrojové kódy

【会员系统】解绑超出限制时,在登录当前设备直接登录

dinglingui 1 týždeň pred
rodič
commit
6a65b88c74

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

@@ -295,6 +295,7 @@ class KMSignUpViewModel: ObservableObject {
                         guard self != nil else { return }
                         guard self != nil else { return }
                         if success {
                         if success {
                             KMMemberCenterWindowController.shared.showWindow(nil)
                             KMMemberCenterWindowController.shared.showWindow(nil)
+                            KMMemberCenterWindowController.shared.signUpViewModel = self
                             KMMemberCenterWindowController.shared.memberCenterdeviceResult = result ?? KMMemberCenterResult(loginResult: KMMemberLoginResult(refreshToken: "", accessToken: "", tokenType: "", expiresIn: ""))
                             KMMemberCenterWindowController.shared.memberCenterdeviceResult = result ?? KMMemberCenterResult(loginResult: KMMemberLoginResult(refreshToken: "", accessToken: "", tokenType: "", expiresIn: ""))
                         }
                         }
                     }
                     }

+ 7 - 3
PDF Office/PDF Master/MemberCenter/WindowsController/KMMemberCenterWindowController.swift

@@ -37,6 +37,8 @@ class KMMemberCenterWindowController: NSWindowController {
     @IBOutlet weak var cancelButton: NSButton!
     @IBOutlet weak var cancelButton: NSButton!
     @IBOutlet weak var loginButton: NSButton!
     @IBOutlet weak var loginButton: NSButton!
     
     
+    var signUpViewModel:KMSignUpViewModel?
+    
     static let shared: KMMemberCenterWindowController = {
     static let shared: KMMemberCenterWindowController = {
         let windowC = KMMemberCenterWindowController(windowNibName: "KMMemberCenterWindowController")
         let windowC = KMMemberCenterWindowController(windowNibName: "KMMemberCenterWindowController")
         return windowC
         return windowC
@@ -207,9 +209,11 @@ class KMMemberCenterWindowController: NSWindowController {
     }
     }
     
     
     @IBAction func buttonItemClicked_Login(_ sender: NSButton) {
     @IBAction func buttonItemClicked_Login(_ sender: NSButton) {
-        window?.close()
-
-        KMLoginWindowsController.shared.showWindow(nil)
+        window?.showWaitingView()
+        signUpViewModel?.signUpAction { [weak self] result, _ in
+            self?.window?.hideWaitingView()
+            self?.window?.close()
+        }
     }
     }
     
     
 }
 }