| | |
| | | */
|
| | | @Autowired
|
| | | private JwtAuthenticationTokenFilter authenticationTokenFilter;
|
| | |
|
| | | |
| | | /**
|
| | | * 跨域过滤器
|
| | | */
|
| | |
| | | .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()
|
| | | // 过滤请求
|
| | | .authorizeRequests()
|
| | | // 对于登录login 验证码captchaImage 允许匿名访问
|
| | | .antMatchers("/login", "/captchaImage").anonymous()
|
| | | // 对于登录login 注册register 验证码captchaImage 允许匿名访问
|
| | | .antMatchers("/login", "/register", "/captchaImage").anonymous()
|
| | | .antMatchers(
|
| | | HttpMethod.GET,
|
| | | "/",
|
| | |
| | | "/**/*.js",
|
| | | "/profile/**"
|
| | | ).permitAll()
|
| | | .antMatchers("/common/download**").anonymous()
|
| | | .antMatchers("/common/download/resource**").anonymous()
|
| | | .antMatchers("/swagger-ui.html").anonymous()
|
| | | .antMatchers("/swagger-resources/**").anonymous()
|
| | | .antMatchers("/webjars/**").anonymous()
|
| | |
| | | httpSecurity.addFilterBefore(corsFilter, LogoutFilter.class);
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 强散列哈希加密实现
|
| | | */
|