From bfd1ad288092a4b4a010ea230466f5e86a4e3de4 Mon Sep 17 00:00:00 2001
From: lmw <125975490@qq.com>
Date: 星期二, 24 十二月 2024 10:09:43 +0800
Subject: [PATCH] fix bug

---
 app/src/main/java/com/sinata/xqmuse/network/Functions.kt |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/app/src/main/java/com/sinata/xqmuse/network/Functions.kt b/app/src/main/java/com/sinata/xqmuse/network/Functions.kt
index a161103..d7b0179 100644
--- a/app/src/main/java/com/sinata/xqmuse/network/Functions.kt
+++ b/app/src/main/java/com/sinata/xqmuse/network/Functions.kt
@@ -26,10 +26,10 @@
         override fun isShowToast() = showToast
 
         override fun onError(code: Int, msg: String) {
-            if (code == 700||code == 600){//token无效
+            if (code == 700||code == 401||code == 501){//token无效
                 error(code,"登录已失效")
                 SPUtils.instance().remove(Const.User.TOKEN).remove(Const.User.USER_ID).apply()
-                (activity.application as JkApplication).exit()
+//                (activity.application as JkApplication).exit()
                 activity.startActivity<LoginActivity>()
             }else{
                 super.onError(code, msg)
@@ -52,10 +52,10 @@
         override fun isShowToast() = showToast
 
         override fun onError(code: Int, msg: String) {
-            if (msg == "TOKEN_INVALID"){//token无效
+            if (code == 401||code == 501){//token无效
                 error(code,"登录已失效")
                 SPUtils.instance().remove(Const.User.TOKEN).remove(Const.User.USER_ID).apply()
-                (fragment.activity!!.application as JkApplication).exit()
+//                (fragment.activity!!.application as JkApplication).exit()
                 fragment.startActivity<LoginActivity>()
             }else{
                 super.onError(code, msg)

--
Gitblit v1.7.1