Browse Source

fix swagger icon bug

macro 5 years ago
parent
commit
c42d57cbe1

+ 2 - 1
mall-admin/src/main/java/com/macro/mall/config/SecurityConfig.java

@@ -62,7 +62,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
                         "/**/*.css",
                         "/**/*.js",
                         "/swagger-resources/**",
-                        "/v2/api-docs/**"
+                        "/v2/api-docs/**",
+                        "/webjars/springfox-swagger-ui/**"
                 )
                 .permitAll()
                 .antMatchers("/admin/login", "/admin/register")// 对登录注册要允许匿名访问

+ 2 - 1
mall-portal/src/main/java/com/macro/mall/portal/config/SecurityConfig.java

@@ -38,7 +38,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
                         "/**/*.css",
                         "/**/*.js",
                         "/swagger-resources/**",
-                        "/v2/api-docs/**"
+                        "/v2/api-docs/**",
+                        "/webjars/springfox-swagger-ui/**"
                 )
                 .permitAll()
                 .antMatchers(HttpMethod.OPTIONS)//跨域请求会先进行一次options请求