Browse Source

1.拦截器修改异常抛出逻辑

20241218TB223FC(测试jar包)
wangwanlei 8 months ago
parent
commit
aa143c92e7

+ 4
- 5
corelib/src/main/java/com/xhly/corelib/network/ResponseInterceptor.kt View File

@@ -39,15 +39,14 @@ class ResponseInterceptor : Interceptor {
39 39
                 charset = contentType.charset(charset)
40 40
             }
41 41
             val bodyString = buffer.clone().readString(charset)
42
-            val data = GsonUtils.parseJsonWithGson(bodyString, ResponseData::class.java)
43
-            if (data == null) {
44
-                throw RuntimeException("数据为空")
45
-            } else {
42
+         /*   val data = GsonUtils.parseJsonWithGson(bodyString, ResponseData::class.java)
43
+            if (data != null) {
44
+            //TODO 接口统一退出
46 45
                 if (data.code == 401) {
47 46
                     //强制退出
48 47
                     UIEvent(Const.LOGIN_OUT_401).post()
49 48
                 }
50
-            }
49
+            }*/
51 50
             originalResponse
52 51
         } catch (e: Exception) {
53 52
             e.printStackTrace()

Loading…
Cancel
Save