|
@@ -102,14 +102,32 @@ class KMUserInfoVCModel: ObservableObject {
|
|
|
@abstract 注销账户;
|
|
|
*/
|
|
|
func closeAccountAction() -> Void {
|
|
|
- if KMMemberInfo.shared.vip_status == 1 {
|
|
|
- NotificationCenter.default.post(name: NSNotification.Name("CloseMenuNotification"), object: nil)
|
|
|
- KMMemberPromptWC.shared.tipType = .unsubscribe
|
|
|
- KMMemberPromptWC.shared.showWindow(nil)
|
|
|
+ if KMMemberInfo.shared.validFlag == "5" {
|
|
|
+ // 撤销注销申请
|
|
|
+ KMMemberCenterManager.manager.userRevokeCancel { success, result in
|
|
|
+ guard let result = result else { return }
|
|
|
+ let resultDict = result as KMMemberCenterResult
|
|
|
+ let msg = resultDict.msg
|
|
|
+ if success {
|
|
|
+ self.refreshUserInfo { success, msg in
|
|
|
+ // 撤销注销申请后刷新用户数据
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ print(msg as Any)
|
|
|
+ }
|
|
|
+ }
|
|
|
} else {
|
|
|
- NotificationCenter.default.post(name: NSNotification.Name("CloseMenuNotification"), object: nil)
|
|
|
- KMMemberPromptWC.shared.tipType = .signout
|
|
|
- KMMemberPromptWC.shared.showWindow(nil)
|
|
|
+ if KMMemberInfo.shared.vip_status == 1 {
|
|
|
+ // 订阅用户提示退订
|
|
|
+ NotificationCenter.default.post(name: NSNotification.Name("CloseMenuNotification"), object: nil)
|
|
|
+ KMMemberPromptWC.shared.tipType = .unsubscribe
|
|
|
+ KMMemberPromptWC.shared.showWindow(nil)
|
|
|
+ } else {
|
|
|
+ // 手动注销
|
|
|
+ NotificationCenter.default.post(name: NSNotification.Name("CloseMenuNotification"), object: nil)
|
|
|
+ KMMemberPromptWC.shared.tipType = .signout
|
|
|
+ KMMemberPromptWC.shared.showWindow(nil)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|