|
@@ -70,13 +70,13 @@ class KMLoginWindowController: NSWindowController {
|
|
|
|
|
|
func setup() {
|
|
|
|
|
|
- KMRequestServer.requestServer.reachabilityStatusChange { [unowned self] status in
|
|
|
+ KMRequestServer.requestServer.reachabilityStatusChange { [weak self] status in
|
|
|
if status == .notReachable {
|
|
|
print("无网络")
|
|
|
- self.noNetworkView.isHidden = false
|
|
|
+ self?.noNetworkView.isHidden = false
|
|
|
} else {
|
|
|
print("有网络")
|
|
|
- self.noNetworkView.isHidden = true
|
|
|
+ self?.noNetworkView.isHidden = true
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -100,7 +100,30 @@ class KMLoginWindowController: NSWindowController {
|
|
|
self.model.email = data.email
|
|
|
self.logType = .loginInputPassword
|
|
|
} else {
|
|
|
- self.loginView.showAlert(result: result)
|
|
|
+ if result?.code == 318 {
|
|
|
+ let alert = NSAlert()
|
|
|
+ alert.messageText = NSLocalizedString("Unable to log", comment: "")
|
|
|
+ alert.informativeText = NSLocalizedString("Your account is currently being logged out and cannot be logged in.If you have questions, you can contact customer service", comment: "")
|
|
|
+ alert.addButton(withTitle: NSLocalizedString("Contact Customer", comment: ""))
|
|
|
+ alert.addButton(withTitle: NSLocalizedString("Cancel", comment: ""))
|
|
|
+ alert.beginSheetModal(for: view.window!) { result in
|
|
|
+ if (result == .alertFirstButtonReturn) {
|
|
|
+ // KMMailHelper.newEmail(withContacts: "support@pdfreaderpro.com", andSubjects: "")
|
|
|
+ // NSWorkspace.shared.launchApplication("Mailto:support@pdfreaderpro.com")
|
|
|
+ NSWorkspace.shared.open(URL(string: "mailto:support@pdfreaderpro.com")!)
|
|
|
+
|
|
|
+ // let service = NSSharingService(named: NSSharingService.Name.composeEmail)
|
|
|
+ // service?.recipients = ["support@pdfreaderpro.com"]
|
|
|
+ // service?.subject = "Test Mail"
|
|
|
+ // service?.perform(withItems: ["Test Mail body"])
|
|
|
+ } else if result == .alertSecondButtonReturn {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return
|
|
|
+ } else {
|
|
|
+ self.loginView.showAlert(result: result)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -202,7 +225,7 @@ class KMLoginWindowController: NSWindowController {
|
|
|
alert.informativeText = NSLocalizedString("Your account is currently being logged out and cannot be logged in.If you have questions, you can contact customer service", comment: "")
|
|
|
alert.addButton(withTitle: NSLocalizedString("Contact Customer", comment: ""))
|
|
|
alert.addButton(withTitle: NSLocalizedString("Cancel", comment: ""))
|
|
|
- alert.beginSheetModal(for: NSApp.mainWindow!) { result in
|
|
|
+ alert.beginSheetModal(for: view.window!) { result in
|
|
|
if (result == .alertFirstButtonReturn) {
|
|
|
// KMMailHelper.newEmail(withContacts: "support@pdfreaderpro.com", andSubjects: "")
|
|
|
// NSWorkspace.shared.launchApplication("Mailto:support@pdfreaderpro.com")
|