wangyunpeng 3 mesi fa
parent
commit
0c5e99ac59

+ 4 - 0
api-module/src/main/java/com/tzld/piaoquan/api/config/JwtInterceptor.java

@@ -32,6 +32,7 @@ public class JwtInterceptor implements HandlerInterceptor {
             0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(100000),
             new ThreadFactoryBuilder().setNameFormat("login-service-pool-%d").build(), new ThreadPoolExecutor.AbortPolicy());
 
+    private static final String SLASH = "/";
     public static String TOKEN_PREFIX = "login.{token}";
     private Set<String> excludePaths;
     private Set<String> excludeUris;
@@ -95,6 +96,9 @@ public class JwtInterceptor implements HandlerInterceptor {
     }
 
     private boolean exclude(String uri) {
+        if (SLASH.equals(uri)) {
+            return true;
+        }
         for (String path : excludePaths) {
             if (uri.startsWith(path)) {
                 return true;

+ 6 - 2
api-module/src/main/resources/application.properties

@@ -48,14 +48,18 @@ aliyun.log.logstore.info=info-log
 aliyun.log.logstore.error=error-log
 
 
-author.interceptor.excludePaths[0]=/swagger/
+author.interceptor.excludePaths[0]=/swagger
 author.interceptor.excludePaths[1]=/api-docs/
-author.interceptor.excludePaths[2]=/swagger-resources/
+author.interceptor.excludePaths[2]=/swagger-resources
 author.interceptor.excludePaths[3]=/account/
 author.interceptor.excludePaths[4]=/cgi/
 author.interceptor.excludePaths[5]=/wecom/
 author.interceptor.excludePaths[6]=/3rdParty/
 author.interceptor.excludePaths[7]=/contentPlatform/account/
+author.interceptor.excludePaths[8]=/webjars/
+author.interceptor.excludePaths[9]=/swagger-ui.html/
 author.interceptor.excludeUris[0]=/login
 author.interceptor.excludeUris[1]=/api-docs
 author.interceptor.excludeUris[2]=/swagger-ui.html
+author.interceptor.excludeUris[3]=/error
+author.interceptor.excludeUris[4]=/csrf