| | |
| | | // 过滤请求
|
| | | .authorizeRequests()
|
| | | // 对于登录login 注册register 验证码captchaImage 允许匿名访问
|
| | | .antMatchers("/login", "/register", "/captchaImage").anonymous()
|
| | | .antMatchers(
|
| | | HttpMethod.GET,
|
| | | "/",
|
| | | "/*.html",
|
| | | "/**/*.html",
|
| | | "/**/*.css",
|
| | | "/**/*.js",
|
| | | "/profile/**"
|
| | | ).permitAll()
|
| | | .antMatchers("/common/download**").anonymous()
|
| | | .antMatchers("/common/download/resource**").anonymous()
|
| | | .antMatchers("/swagger-ui.html").anonymous()
|
| | | .antMatchers("/swagger-resources/**").anonymous()
|
| | | .antMatchers("/webjars/**").anonymous()
|
| | | .antMatchers("/*/api-docs").anonymous()
|
| | | .antMatchers("/druid/**").anonymous()
|
| | | .antMatchers("/login", "/register", "/captchaImage").permitAll()
|
| | | // 静态资源,可匿名访问
|
| | | .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
|
| | | .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
|
| | | // 除上面外的所有请求全部需要鉴权认证
|
| | | .anyRequest().authenticated()
|
| | | .and()
|