From e54a57cc7130613b112e573f4048e20bc6f3a841 Mon Sep 17 00:00:00 2001 From: liangzhenying <867174124@qq.com> Date: Thu, 19 Mar 2026 15:24:36 +0800 Subject: [PATCH] =?utf8?q?=E5=A2=9E=E5=8A=A0=E8=B4=A6=E5=8F=B7=E6=8C=A4?= =?utf8?q?=E4=B8=8B=E7=BA=BF=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- ShenYin/ShenYin/Api/HttpClient.swift | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) 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() + } } } -- 2.17.1