|
@@ -105,6 +105,31 @@ class KMUserInfoViewController: NSViewController {
|
|
|
deinit {
|
|
|
KMPrint("KMUserInfoViewController deinit.")
|
|
|
}
|
|
|
+
|
|
|
+ @objc class func refreshTokenUserInfo(callback: ((Bool)->Void)?) -> Void {
|
|
|
+ if KMMemberCenterManager.manager.isConnectionAvailable() == false {
|
|
|
+ let alert = NSAlert()
|
|
|
+ alert.alertStyle = .critical
|
|
|
+ alert.messageText = NSLocalizedString("Error Information", comment: "")
|
|
|
+ alert.informativeText = NSLocalizedString("Please make sure your internet connection is available.", comment: "")
|
|
|
+ alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
|
|
|
+ alert.runModal()
|
|
|
+
|
|
|
+ callback?(false)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ KMUserInfoVCModel().refreshUserInfo(networkAlert: false) { success, msg in
|
|
|
+ callback?(success)
|
|
|
+ if success {
|
|
|
+ KMMemberInfo.shared.isLogin = true
|
|
|
+ NotificationCenter.default.post(name: NSNotification.Name(rawValue: "MemberCenterLoginSuccess"), object: nil)
|
|
|
+ } else {
|
|
|
+ KMMemberInfo.shared.isLogin = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
override func viewDidLoad() {
|
|
|
super.viewDidLoad()
|