2 Commits 07f0878fd0 ... e51c338d5d

Author SHA1 Message Date
  Gogs e51c338d5d 邀请收益绑定修复 1 month ago
  Gogs f5f3d4c3c6 注释掉测试服务地址 1 month ago

+ 12 - 8
module_base/src/main/java/com/yc/module_base/net/RequestInterceptor.kt

@@ -73,18 +73,22 @@ class RequestInterceptor() : com.yc.networklibrary.remote.interceptor.RequestInt
         var serverPath = "${url.scheme}://${url.host}/".trim()
         Log.d(TAG, "intercept url: ${url}")
         if (url.encodedPath.startsWith("/api/share/app/share/")) {
-            // val localUrl = url.newBuilder()
-            //     .scheme("http")
-            //     .host("192.168.0.112")
-            //     .port(8880)
-            //     .build()
-            // newRequestBuilder.url(localUrl)
-            // serverPath = "${localUrl.scheme}://${localUrl.host}/".trim()
-            // Log.d(TAG, "rewrite to local: ${localUrl}")
+
+            //  val localUrl = url.newBuilder()
+            //      .scheme("http")
+            //      .host("192.168.0.118")
+            //      .port(8880)
+            //      .build()
+            //  newRequestBuilder.url(localUrl)
+            //  serverPath = "${localUrl.scheme}://${localUrl.host}/".trim()
+            //  Log.d(TAG, "rewrite to local: ${apiPath}")
+
+
             val token = LiveSession.getUserToken()
             if (token.isNotEmpty()) {
                 newRequestBuilder.header("token", token)
             }
+            return chain.proceed(newRequestBuilder.build())
         }
         /*如果请求的不是服务端的接口,不加密*/
         if (!serverPath.startsWith(URL_BASE)) {