|
@@ -115,6 +115,21 @@ class AppDelegate: NSObject, NSApplicationDelegate, iRateDelegate{
|
|
KMKdanRemoteConfig.remoteConfig.fetchWithRemoteConfigCompletionHandler { status, error in
|
|
KMKdanRemoteConfig.remoteConfig.fetchWithRemoteConfigCompletionHandler { status, error in
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ let token = UserDefaults.standard.value(forKey: "MemberAccessToken")
|
|
|
|
+ if token is String {
|
|
|
|
+ if (token as! String).count > 0 {
|
|
|
|
+ KMMemberInfo.shared.access_token = token as! String
|
|
|
|
+ KMUserInfoVCModel().refreshUserInfo { success, msg in
|
|
|
|
+ if success {
|
|
|
|
+ KMMemberInfo.shared.isLogin = true
|
|
|
|
+ NotificationCenter.default.post(name: NSNotification.Name(rawValue: "MemberCenterLoginSuccess"), object: nil)
|
|
|
|
+ } else {
|
|
|
|
+ KMMemberInfo.shared.isLogin = false
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
KMStatusBar.system()
|
|
KMStatusBar.system()
|
|
|
|
|
|
@@ -204,21 +219,6 @@ class AppDelegate: NSObject, NSApplicationDelegate, iRateDelegate{
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- let token = UserDefaults.standard.value(forKey: "MemberAccessToken")
|
|
|
|
- if token is String {
|
|
|
|
- if (token as! String).count > 0 {
|
|
|
|
- KMMemberInfo.shared.access_token = token as! String
|
|
|
|
- KMUserInfoVCModel().refreshUserInfo { success, msg in
|
|
|
|
- if success {
|
|
|
|
- KMMemberInfo.shared.isLogin = true
|
|
|
|
- NotificationCenter.default.post(name: NSNotification.Name(rawValue: "MemberCenterLoginSuccess"), object: nil)
|
|
|
|
- } else {
|
|
|
|
- KMMemberInfo.shared.isLogin = false
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
NotificationCenter.default.addObserver(self, selector: #selector(deviceActivateStatusChangeNotification), name: NSNotification.Name(rawValue: "kDeviceActivateNotification"), object: nil)
|
|
NotificationCenter.default.addObserver(self, selector: #selector(deviceActivateStatusChangeNotification), name: NSNotification.Name(rawValue: "kDeviceActivateNotification"), object: nil)
|
|
|
|
|
|
initDidFinish()
|
|
initDidFinish()
|