增加账号挤下线提示
authorliangzhenying <867174124@qq.com>
Thu, 19 Mar 2026 07:24:36 +0000 (15:24 +0800)
committerliangzhenying <867174124@qq.com>
Thu, 19 Mar 2026 07:24:36 +0000 (15:24 +0800)
ShenYin/ShenYin/Api/HttpClient.swift

index d12a3c4..be85cbb 100644 (file)
@@ -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()
+            }
         }
     }