@Configuration@EnableWEBSecurity@EnableGlobalMethodSecurity(prePostEnabled = true)public class WebSecurityConfig extends
@Configuration
@EnableWEBSecurity
@EnableGlobalMethodSecurity(prePostEnabled = true)
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
private Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
MemDetailsService memDetailsService;
@Autowired
SimpleLoginSuccesshandler simpleLoginSuccessHandler;
@Override
//WebSecurity:For example, if you wish to ignore certain requests.
//用于配置类似防火墙,放行某些URL。
public void configure(WebSecurity web) throws Exception {
// 设置不拦截规则
//web.ignoring().antMatchers("/jsfavicon.ico", "/swagger*favicon.ico", "/image
private final List execludeUrls = new ArrayList() {{
add("/upload");
add("/upload/uploadActivateAttachment");
add("/buy02");
add("/buy02/uploadActivationSel");
}};
}
--结束END--
本文标题: springboot 访问上传页面因csrf出现403的问题
本文链接: https://lsjlt.com/news/231873.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0