Skip to content

Commit 47265f6

Browse files
committed
修复Token为null判断
1 parent 9ce53e5 commit 47265f6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

rest/src/main/java/com/liuhanling/rest/interceptor/BaseTokenInterceptor.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,12 @@ public Response intercept(Chain chain) throws IOException {
3838
return chain.proceed(request);
3939
}
4040

41-
// 添加token到Header
4241
String tokenVal = TokenStore.getInstance().getToken();
42+
if (TextUtils.isEmpty(tokenVal)) {
43+
return chain.proceed(request);
44+
}
45+
46+
// 添加token到Header
4347
request = request.newBuilder()
4448
.removeHeader(tokenKey)
4549
.header(tokenKey, tokenVal)

0 commit comments

Comments
 (0)