|
@@ -162,6 +162,25 @@ class KMUserInfoViewController: NSViewController {
|
|
|
})
|
|
|
}
|
|
|
NotificationCenter.default.addObserver(self, selector: #selector(changeEffectiveAppearance), name: NSNotification.Name(rawValue: "kEffectiveAppearance"), object: nil)
|
|
|
+
|
|
|
+ addWaitingView(to: self.view)
|
|
|
+ KMUserInfoViewController.refreshTokenUserInfo {[weak self] success, resDic in
|
|
|
+ DispatchQueue.main.async {
|
|
|
+ self?.removeWaitingView(from: self?.view ?? NSView())
|
|
|
+ if(success) {
|
|
|
+ if KMMemberInfo.shared.isLogin {
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ NotificationCenter.default.post(name: NSNotification.Name("CloseMenuNotification"), object: nil)
|
|
|
+ let code = resDic?.code
|
|
|
+ if code == 304 {
|
|
|
+ KMLoginWindowsController.shared.showWindow(nil)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@objc func changeEffectiveAppearance() {
|
|
@@ -478,6 +497,23 @@ class KMUserInfoViewController: NSViewController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ func addWaitingView(to view: NSView) {
|
|
|
+ removeWaitingView(from: view)
|
|
|
+ let waitingView = WaitingView(frame: view.bounds)
|
|
|
+ waitingView.autoresizingMask = [.width, .height]
|
|
|
+ view.addSubview(waitingView)
|
|
|
+ waitingView.startAnimation()
|
|
|
+ }
|
|
|
+
|
|
|
+ func removeWaitingView(from view: NSView) {
|
|
|
+ for subview in view.subviews {
|
|
|
+ if subview is WaitingView {
|
|
|
+ subview.removeFromSuperview()
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private func initializeUI() -> Void {
|
|
|
refreshEquity()
|
|
|
|