修改相关资源路径
This commit is contained in:
@@ -1,23 +0,0 @@
|
||||
package com.label.common.context;
|
||||
|
||||
import com.label.common.auth.TokenPrincipal;
|
||||
|
||||
public final class UserContext {
|
||||
private static final ThreadLocal<TokenPrincipal> PRINCIPAL = new ThreadLocal<>();
|
||||
|
||||
public static void set(TokenPrincipal principal) {
|
||||
PRINCIPAL.set(principal);
|
||||
}
|
||||
|
||||
public static TokenPrincipal get() {
|
||||
return PRINCIPAL.get();
|
||||
}
|
||||
|
||||
public static void clear() {
|
||||
PRINCIPAL.remove();
|
||||
}
|
||||
|
||||
private UserContext() {
|
||||
throw new UnsupportedOperationException("Utility class");
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,6 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.label.annotation.RequireRole;
|
||||
import com.label.common.auth.TokenPrincipal;
|
||||
import com.label.common.context.CompanyContext;
|
||||
import com.label.common.context.UserContext;
|
||||
import com.label.common.result.Result;
|
||||
import com.label.service.RedisService;
|
||||
import com.label.util.RedisUtil;
|
||||
@@ -79,7 +78,6 @@ public class AuthInterceptor implements HandlerInterceptor {
|
||||
@Override
|
||||
public void afterCompletion(HttpServletRequest request, HttpServletResponse response,
|
||||
Object handler, Exception ex) {
|
||||
UserContext.clear();
|
||||
CompanyContext.clear();
|
||||
}
|
||||
|
||||
@@ -125,7 +123,6 @@ public class AuthInterceptor implements HandlerInterceptor {
|
||||
|
||||
private void bindPrincipal(HttpServletRequest request, TokenPrincipal principal) {
|
||||
CompanyContext.set(principal.getCompanyId());
|
||||
UserContext.set(principal);
|
||||
request.setAttribute("__token_principal__", principal);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user