Browse Source

代码优化

zhoutg 6 năm trước cách đây
mục cha
commit
9a9c253e7d

+ 1 - 8
icssman-service/src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java

@@ -1,19 +1,12 @@
 package com.diagbot.config.security;
 
 import com.diagbot.client.UserServiceClient;
-import com.diagbot.dto.RespDTO;
-import com.diagbot.entity.Token;
-import com.diagbot.util.HttpUtils;
-import com.diagbot.util.StringUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.AccessDecisionManager;
 import org.springframework.security.access.AccessDeniedException;
 import org.springframework.security.access.ConfigAttribute;
-import org.springframework.security.authentication.AccountExpiredException;
 import org.springframework.security.authentication.InsufficientAuthenticationException;
 import org.springframework.security.core.Authentication;
-import org.springframework.security.core.GrantedAuthority;
-import org.springframework.security.web.FilterInvocation;
 import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
 import org.springframework.stereotype.Service;
 
@@ -48,7 +41,7 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
 //                tokenStr = tokenStr.replaceFirst("Bearer ", "");
 //                token.setToken(tokenStr);
 //                RespDTO<Boolean> res = userServiceClient.verifyToken(token);
-//                if (res == null || !CommonErrorCode.OK.getCode()(res.code)) {
+//                if (res == null || !CommonErrorCode.OK.getCode().equals(res.code)) {
 //                    throw new AccountExpiredException("token expire");
 //                }
 //                if (!res.data) {