فهرست منبع

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

dinglingui 1 هفته پیش
والد
کامیت
6a65b88c74

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

@@ -295,6 +295,7 @@ class KMSignUpViewModel: ObservableObject {
                         guard self != nil else { return }
                         if success {
                             KMMemberCenterWindowController.shared.showWindow(nil)
+                            KMMemberCenterWindowController.shared.signUpViewModel = self
                             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 loginButton: NSButton!
     
+    var signUpViewModel:KMSignUpViewModel?
+    
     static let shared: KMMemberCenterWindowController = {
         let windowC = KMMemberCenterWindowController(windowNibName: "KMMemberCenterWindowController")
         return windowC
@@ -207,9 +209,11 @@ class KMMemberCenterWindowController: NSWindowController {
     }
     
     @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()
+        }
     }
     
 }