Browse Source

【会员系统】补充退出账号清空会员model

wanjun 3 months ago
parent
commit
9cd109d933

+ 44 - 0
PDF Office/PDF Master/MemberCenter/Model/KMMemberInfo.swift

@@ -641,4 +641,48 @@ import Cocoa
         }
         return false
     }
+    
+    func clearMemberInfoCache() -> Void {
+        currentLogoutStatus = .null
+        _refresh_token = ""
+        _access_token = ""
+        _token_type = ""
+        _expires_in = ""
+        _scope = ""
+        userID = ""
+        userEmail = ""
+        fullName = ""
+        _activeVips = []
+        _activeAis = []
+        vip_id = ""
+        vip_userId = ""
+        vip_status = 0
+        vip_endDate = ""
+        vip_payType = 0
+        vip_productName = ""
+        vip_levels = ""
+        vip_platforms = ""
+        vip_point = 0
+        vip_maxDeviceNum = 0
+        vip_paymentModel = ""
+        vip_isAi = ""
+        vip_cycle = 0
+        ai_id = ""
+        ai_userId = ""
+        ai_status = 0
+        ai_endDate = ""
+        ai_payType = 0
+        ai_productName = ""
+        ai_levels = ""
+        ai_platforms = ""
+        ai_point = 0
+        ai_maxDeviceNum = 0
+        ai_paymentModel = ""
+        ai_isAi = ""
+        ai_cycle = 0
+        aiPoint = 0
+        validFlag = ""
+        isHaveAIDiscount = ""
+        canTrail = false
+    }
 }

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

@@ -184,6 +184,7 @@ class KMUserInfoVCModel: ObservableObject {
             if success {
                 let islogout: Bool = resultDict.result!
                 if islogout {
+                    KMMemberInfo.shared.clearMemberInfoCache()
                     KMMemberInfo.shared.isLogin = false
                     KMMemberInfo.shared.access_token = ""
                     NotificationCenter.default.post(name: NSNotification.Name(rawValue: "MemberCenterLogoutSuccess"), object: nil)