状态:
通过浏览器发送访问请求:
localhost:9000/files/download
输入user和密码
密码如果不设置在启动的时候控制台会有
Using generated security password: 75a2959a-522c-4335-830d-d247e7b4743b
会正常访问
解决方式
@Configuration
public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Override
public void configure(WebSecurity web) throws Exception {
//忽略权限授权接口,填写路径就好
web.ignoring().antMatchers("/sysUsers/*", "/auth/*", "/files/*");
}
// @Override
// public void configure(HttpSecurity http) throws Exception {
//// 任意请求允许无授权访问
// http.authorizeRequests()
// .anyRequest().permitAll();
//// http.csrf().disable().exceptionHandling().authenticationEntryPoint(getAccessDeniedHandler());
// }
}