1234567891011121314151617181920212223242526272829303132333435363738394041 |
- //
- // AccountManager.swift
- // PDF Reader Pro
- //
- // Created by User-Tangchao on 2024/11/1.
- //
- import Cocoa
- @objcMembers class AccountManager: NSObject {
-
- static let manager = AccountManager()
-
- var isLogin = false
-
- var isVip = false
-
- var hasAiPermissions = false
- var aiBuyUrl: String?
-
- // 是否适用中
- var isTrialing = false
-
- var canUseAdvanceFlag = false
-
- func saveRights(model: AccountRightModel?) {
- if let data = model {
- self.isLogin = true
- self.isVip = data.isVip == 1
- self.hasAiPermissions = data.hasAiPermissions == 1
- self.aiBuyUrl = data.aiBuyUrl
- self.isTrialing = data.trialData?.status == 1
- } else {
- self.isLogin = false
- self.isVip = false
- self.hasAiPermissions = false
- self.aiBuyUrl = nil
- self.isTrialing = false
- }
- }
- }
|