首页>代码>基于SpringBoot+SpringBoot Data Jpa+Mysql的自适应摄影管理系统>/Shoot/src/main/java/com/java214/config/WebSecurityConfig.java
package com.java214.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;

/***
 *@author java214
 *@site www.java214.com
 *@company 一帆风顺网络科技有限公司
 *@create 2019-11-30 21:30
 *
 *
 *
 *
 */
@Configuration
@EnableGlobalMethodSecurity(prePostEnabled = true)
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {


    @Override
    protected void configure(HttpSecurity http) throws Exception {
        //配置请求路径,允许跨域等,配置某些配置不需要认证
        http.csrf().disable().cors().disable().headers()
                .disable().authorizeRequests()
                .antMatchers("/", "/static/**","/admin/**","/layout/**","/shoot/**","/404")
                .permitAll().and().logout().permitAll();    //配置不需要身份认证的请求地址

    }
}
最近下载更多
zolscy  LV24 2024年11月26日
TY0165  LV20 2024年6月16日
molu123456 2024年6月4日
暂无贡献等级
朱朱啊哈  LV16 2024年4月8日
wanglinddad  LV55 2024年3月13日
2781674049  LV1 2024年3月5日
akkye_7  LV1 2024年1月8日
lilong007  LV23 2023年12月30日
逝水莲花  LV7 2023年12月1日
2410068425  LV23 2023年11月27日
最近浏览更多
fantesy  LV17 3月24日
orang801  LV2 3月3日
陈小灏  LV18 2月22日
kkkxyh  LV13 2月11日
ryadmin123  LV2 2月6日
xiejingxun  LV2 2024年12月31日
gxh999810  LV1 2024年12月13日
zolscy  LV24 2024年11月26日
yimaoermao  LV1 2024年9月14日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友