|
@@ -22,7 +22,7 @@ import com.ruoyi.framework.security.handle.LogoutSuccessHandlerImpl;
|
|
|
|
|
|
/**
|
|
/**
|
|
* spring security配置
|
|
* spring security配置
|
|
- *
|
|
|
|
|
|
+ *
|
|
* @author ruoyi
|
|
* @author ruoyi
|
|
*/
|
|
*/
|
|
@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
|
|
@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
|
|
@@ -33,7 +33,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
|
|
*/
|
|
*/
|
|
@Autowired
|
|
@Autowired
|
|
private UserDetailsService userDetailsService;
|
|
private UserDetailsService userDetailsService;
|
|
-
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 认证失败处理类
|
|
* 认证失败处理类
|
|
*/
|
|
*/
|
|
@@ -51,7 +51,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
|
|
*/
|
|
*/
|
|
@Autowired
|
|
@Autowired
|
|
private JwtAuthenticationTokenFilter authenticationTokenFilter;
|
|
private JwtAuthenticationTokenFilter authenticationTokenFilter;
|
|
-
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 跨域过滤器
|
|
* 跨域过滤器
|
|
*/
|
|
*/
|
|
@@ -115,6 +115,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
|
|
// 静态资源,可匿名访问
|
|
// 静态资源,可匿名访问
|
|
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
|
|
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
|
|
.antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
|
|
.antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
|
|
|
|
+ .antMatchers("/ehs/approvedanger/processImg/**").anonymous()
|
|
// 除上面外的所有请求全部需要鉴权认证
|
|
// 除上面外的所有请求全部需要鉴权认证
|
|
.anyRequest().authenticated()
|
|
.anyRequest().authenticated()
|
|
.and()
|
|
.and()
|