Ver código fonte

Merge branch 'bgy' of SH-Arbitrate/Arbitrate-Backend into dev

bgy 2 anos atrás
pai
commit
25c201b472

+ 6
- 10
ruoyi-common/src/main/java/com/ruoyi/common/enums/HttpMethod.java Ver arquivo

@@ -2,6 +2,7 @@ package com.ruoyi.common.enums;
2 2
 
3 3
 import java.util.HashMap;
4 4
 import java.util.Map;
5
+
5 6
 import org.springframework.lang.Nullable;
6 7
 
7 8
 /**
@@ -9,28 +10,23 @@ import org.springframework.lang.Nullable;
9 10
  *
10 11
  * @author ruoyi
11 12
  */
12
-public enum HttpMethod
13
-{
13
+public enum HttpMethod {
14 14
     GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS, TRACE;
15 15
 
16 16
     private static final Map<String, HttpMethod> mappings = new HashMap<>(16);
17 17
 
18
-    static
19
-    {
20
-        for (HttpMethod httpMethod : values())
21
-        {
18
+    static {
19
+        for (HttpMethod httpMethod : values()) {
22 20
             mappings.put(httpMethod.name(), httpMethod);
23 21
         }
24 22
     }
25 23
 
26 24
     @Nullable
27
-    public static HttpMethod resolve(@Nullable String method)
28
-    {
25
+    public static HttpMethod resolve(@Nullable String method) {
29 26
         return (method != null ? mappings.get(method) : null);
30 27
     }
31 28
 
32
-    public boolean matches(String method)
33
-    {
29
+    public boolean matches(String method) {
34 30
         return (this == resolve(method));
35 31
     }
36 32
 }

+ 1
- 1
ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java Ver arquivo

@@ -111,7 +111,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
111 111
                 // 过滤请求
112 112
                 .authorizeRequests()
113 113
                 // 对于登录login 注册register 验证码captchaImage 允许匿名访问
114
-                .antMatchers("/login", "/register", "/captchaImage").permitAll()
114
+                .antMatchers("/login", "/register", "/captchaImage","/home/**").permitAll()
115 115
                 // 静态资源,可匿名访问
116 116
                 .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
117 117
                 .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()