修复打包后静态页面加载异常

This commit is contained in:
panlinlin
2021-04-19 11:04:11 +08:00
parent 5b18172896
commit 41ca4e938d
7 changed files with 26 additions and 23 deletions

View File

@@ -69,9 +69,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
// 可以直接访问的静态数据
web.ignoring()
.antMatchers("/")
.antMatchers("/css/**")
.antMatchers("/img/**")
.antMatchers("/fonts/**")
.antMatchers("/static/**")
.antMatchers("/index.html")
.antMatchers("/doc.html") // "/webjars/**", "/swagger-resources/**", "/v3/api-docs/**"
.antMatchers("/webjars/**")
@@ -100,6 +98,8 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http.cors().and().csrf().disable();
// 设置允许添加静态文件
http.headers().contentTypeOptions().disable();
http.authorizeRequests()
// 放行接口
.antMatchers("/api/user/login","/index/hook/**").permitAll()