This commit is contained in:
linshujie 2026-09-11 10:18:43 +08:00
parent 44420e6cab
commit bd60edb681
5 changed files with 14 additions and 21 deletions

View File

@ -65,7 +65,10 @@ class AppContextManager: NSObject {
/// 1 2 3 /// 1 2 3
var vip: Int { var vip: Int {
account?.vip ?? 1 guard AppContextManager.shared.systemConfig?.isIntercept == false else {
return 2
}
return account?.vip ?? 1
} }
/// 0 1SOS 2 /// 0 1SOS 2
var status: Int { var status: Int {

View File

@ -88,8 +88,12 @@ extension ApiManager {
} }
let code = json["code"].int let code = json["code"].int
let success: Bool? = json["success"].bool let success: Bool? = json["success"].bool
let message = json["message"].string
let combineMessage = message ?? "请检查网络连接" let message = json["message"].string?
.split(separator: ",", maxSplits: 1, omittingEmptySubsequences: false)
.first
.map(String.init)?
.trimmingCharacters(in: .whitespacesAndNewlines) ?? "请检查网络连接"
// code // code
switch code { switch code {
@ -124,12 +128,12 @@ extension ApiManager {
/// ///
let code = GatewayStatusCode(rawValue: code ?? -9999) ?? .unknownError let code = GatewayStatusCode(rawValue: code ?? -9999) ?? .unknownError
if code == .unknownError, handle { if code == .unknownError, handle {
DLToast.show(text: combineMessage) DLToast.show(text: message)
} }
} }
return .failure(handleError(with: code, return .failure(handleError(with: code,
domain: "Data Error", domain: "Data Error",
message: combineMessage, message: message,
isShowTip: code != GatewayStatusCode.needVip.rawValue, isShowTip: code != GatewayStatusCode.needVip.rawValue,
data: response)) data: response))
case let .failure(error): case let .failure(error):
@ -185,13 +189,8 @@ extension ApiManager {
// MARK: - VIP // MARK: - VIP
private func handleNeedVip(_ msg: String) { private func handleNeedVip(_ msg: String) {
let message = msg
.split(separator: ",", maxSplits: 1, omittingEmptySubsequences: false)
.first
.map(String.init)?
.trimmingCharacters(in: .whitespacesAndNewlines) ?? ""
MainAsync { MainAsync {
UIViewController.showConfirmPop(title: "温馨提示", message: message, confirmText: "去开通", confirmBlock: { UIViewController.showConfirmPop(title: "温馨提示", message: msg, confirmText: "去开通", confirmBlock: {
AppRouter.push(Route.vipRecharge) AppRouter.push(Route.vipRecharge)
}, cancelText: "取消") }, cancelText: "取消")
} }

View File

@ -573,10 +573,6 @@ final class GroupChatVC: BaseViewController {
// MARK: - Actions // MARK: - Actions
private var isVipUnlocked: Bool { private var isVipUnlocked: Bool {
guard AppContextManager.shared.systemConfig?.isIntercept == false else {
return false
}
return AppContextManager.shared.vip > 1 return AppContextManager.shared.vip > 1
} }

View File

@ -95,10 +95,6 @@ class CreateBubbleVC: BaseViewController {
} }
private var isVipUnlocked: Bool { private var isVipUnlocked: Bool {
guard AppContextManager.shared.systemConfig?.isIntercept == false else {
return false
}
return AppContextManager.shared.vip > 1 return AppContextManager.shared.vip > 1
} }

View File

@ -43,8 +43,7 @@ enum LoginSessionHandler {
NotificationCenter.default.post(name: .RefreshUserConfigNotification, object: nil) NotificationCenter.default.post(name: .RefreshUserConfigNotification, object: nil)
} }
}, onError: { error in }, onError: { error in
DLToast.dismiss() DLToast.showError(text: error.localizedDescription)
DLToast.showError(text: "登录失败,请重试")
}).disposed(by: disposeBag) }).disposed(by: disposeBag)
} }
} }