|
|
|
@ -20,7 +20,7 @@ import com.ruoyi.framework.security.handle.LogoutSuccessHandlerImpl;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* spring security配置
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* @author ruoyi
|
|
|
|
|
*/
|
|
|
|
|
@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
|
|
|
|
@ -31,7 +31,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
|
|
|
|
|
*/
|
|
|
|
|
@Autowired
|
|
|
|
|
private UserDetailsService userDetailsService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 认证失败处理类
|
|
|
|
|
*/
|
|
|
|
@ -49,13 +49,13 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
|
|
|
|
|
*/
|
|
|
|
|
@Autowired
|
|
|
|
|
private JwtAuthenticationTokenFilter authenticationTokenFilter;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 跨域过滤器
|
|
|
|
|
*/
|
|
|
|
|
@Autowired
|
|
|
|
|
private CorsFilter corsFilter;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 解决 无法直接注入 AuthenticationManager
|
|
|
|
|
*
|
|
|
|
@ -97,7 +97,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
|
|
|
|
|
// 过滤请求
|
|
|
|
|
.authorizeRequests()
|
|
|
|
|
// 对于登录login 注册register 验证码captchaImage 允许匿名访问
|
|
|
|
|
.antMatchers("/login", "/login/app","/login/app/fill/info","/register", "/captchaImage").anonymous()
|
|
|
|
|
.antMatchers("/login", "/login/app","/login/app/fill/info","/register", "/captchaImage","/common/upload").anonymous()
|
|
|
|
|
.antMatchers(
|
|
|
|
|
HttpMethod.GET,
|
|
|
|
|
"/",
|
|
|
|
|