From: liangzhenying <867174124@qq.com> Date: Thu, 19 Mar 2026 07:24:36 +0000 (+0800) Subject: 增加账号挤下线提示 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=e54a57cc7130613b112e573f4048e20bc6f3a841;p=mirrors%2FShenYin.git 增加账号挤下线提示 --- diff --git a/ShenYin/ShenYin/Api/HttpClient.swift b/ShenYin/ShenYin/Api/HttpClient.swift index d12a3c4..be85cbb 100644 --- a/ShenYin/ShenYin/Api/HttpClient.swift +++ b/ShenYin/ShenYin/Api/HttpClient.swift @@ -636,11 +636,9 @@ extension HttpClient{ return } let responseStr = response.data.string ?? "" -// if let code = dict["code"] as? Int,code == 50000{ -// YLprogressHUD.showAutoHiden(text: "当前账号已经退出登录"){ -// CacheManager.shared.user.logout() -// } -// } + if let code = dict["code"] as? Int,code == 50001,let msg = dict["msg"] as? String,msg == "账号未登录"{ + CacheManager.shared.user.logout() + } if let res = T.deserialize(from: dict){ completionHandler(res,responseStr) return @@ -671,11 +669,9 @@ extension HttpClient{ return } completionHandler(T(),"请求失败".l10n) -// if let code = dict["code"] as? Int,code == 50001{ -// YLprogressHUD.showAutoHiden(text: "当前账号已经退出登录"){ -// CacheManager.shared.user.logout() -// } -// } + if let code = dict["code"] as? Int,code == 50001,let msg = dict["msg"] as? String,msg == "账号未登录"{ + CacheManager.shared.user.logout() + } } }