|
@@ -73,14 +73,14 @@ class RequestInterceptor() : com.yc.networklibrary.remote.interceptor.RequestInt
|
|
|
var serverPath = "${url.scheme}://${url.host}/".trim()
|
|
var serverPath = "${url.scheme}://${url.host}/".trim()
|
|
|
Log.d(TAG, "intercept url: ${url}")
|
|
Log.d(TAG, "intercept url: ${url}")
|
|
|
if (url.encodedPath.startsWith("/api/share/app/share/")) {
|
|
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.112")
|
|
|
|
|
+ // .port(8880)
|
|
|
|
|
+ // .build()
|
|
|
|
|
+ // newRequestBuilder.url(localUrl)
|
|
|
|
|
+ // serverPath = "${localUrl.scheme}://${localUrl.host}/".trim()
|
|
|
|
|
+ // Log.d(TAG, "rewrite to local: ${localUrl}")
|
|
|
val token = LiveSession.getUserToken()
|
|
val token = LiveSession.getUserToken()
|
|
|
if (token.isNotEmpty()) {
|
|
if (token.isNotEmpty()) {
|
|
|
newRequestBuilder.header("token", token)
|
|
newRequestBuilder.header("token", token)
|