RuoYi 5 yıl önce
ebeveyn
işleme
3603582c88
61 değiştirilmiş dosya ile 1306 ekleme ve 302 silme
  1. 7 2
      README.md
  2. 3 11
      pom.xml
  3. 1 1
      ruoyi-api/pom.xml
  4. 1 1
      ruoyi-api/ruoyi-api-system/pom.xml
  5. 13 1
      ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/RemoteLogService.java
  6. 0 1
      ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/RemoteUserService.java
  7. 0 14
      ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysOperLog.java
  8. 7 0
      ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/factory/RemoteLogFallbackFactory.java
  9. 1 1
      ruoyi-auth/pom.xml
  10. 14 0
      ruoyi-auth/src/main/java/com/ruoyi/auth/controller/TokenController.java
  11. 39 0
      ruoyi-auth/src/main/java/com/ruoyi/auth/handler/AuthenticationSuccessEventHandler.java
  12. 1 1
      ruoyi-common/pom.xml
  13. 1 1
      ruoyi-common/ruoyi-common-core/pom.xml
  14. 5 0
      ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/Constants.java
  15. 1 0
      ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/SecurityConstants.java
  16. 1 1
      ruoyi-common/ruoyi-common-datascope/pom.xml
  17. 1 7
      ruoyi-common/ruoyi-common-log/pom.xml
  18. 1 1
      ruoyi-common/ruoyi-common-redis/pom.xml
  19. 0 2
      ruoyi-common/ruoyi-common-redis/src/main/java/com/ruoyi/common/redis/configure/RedisConfig.java
  20. 1 1
      ruoyi-common/ruoyi-common-security/pom.xml
  21. 0 1
      ruoyi-common/ruoyi-common-security/src/main/java/com/ruoyi/common/security/config/SecurityImportBeanDefinitionRegistrar.java
  22. 1 1
      ruoyi-common/ruoyi-common-swagger/pom.xml
  23. 33 15
      ruoyi-gateway/pom.xml
  24. 32 0
      ruoyi-gateway/src/main/java/com/ruoyi/gateway/config/GatewayConfig.java
  25. 4 11
      ruoyi-gateway/src/main/java/com/ruoyi/gateway/config/RouterFunctionConfiguration.java
  26. 0 36
      ruoyi-gateway/src/main/java/com/ruoyi/gateway/handler/HystrixFallbackHandler.java
  27. 47 0
      ruoyi-gateway/src/main/java/com/ruoyi/gateway/handler/SentinelFallbackHandler.java
  28. 0 3
      ruoyi-gateway/src/main/java/com/ruoyi/gateway/service/impl/ValidateCodeServiceImpl.java
  29. 17 0
      ruoyi-gateway/src/main/resources/bootstrap.yml
  30. 1 1
      ruoyi-modules/pom.xml
  31. 4 4
      ruoyi-modules/ruoyi-gen/pom.xml
  32. 1 1
      ruoyi-modules/ruoyi-gen/src/main/java/com/ruoyi/gen/util/VelocityUtils.java
  33. 11 9
      ruoyi-modules/ruoyi-gen/src/main/resources/vm/java/controller.java.vm
  34. 0 9
      ruoyi-modules/ruoyi-gen/src/main/resources/vm/js/api.js.vm
  35. 4 11
      ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index.vue.vm
  36. 4 4
      ruoyi-modules/ruoyi-job/pom.xml
  37. 4 4
      ruoyi-modules/ruoyi-system/pom.xml
  38. 94 0
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysClientDetailsController.java
  39. 28 1
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysLogininforController.java
  40. 197 0
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysClientDetails.java
  41. 11 53
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysLogininfor.java
  42. 60 0
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysClientDetailsMapper.java
  43. 1 1
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysLogininforMapper.java
  44. 60 0
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysClientDetailsService.java
  45. 1 1
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysLogininforService.java
  46. 92 0
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysClientDetailsServiceImpl.java
  47. 2 2
      ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysLogininforServiceImpl.java
  48. 95 0
      ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysClientDetailsMapper.xml
  49. 6 9
      ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysLogininforMapper.xml
  50. 3 4
      ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysOperLogMapper.xml
  51. 44 0
      ruoyi-ui/src/api/system/client.js
  52. 1 0
      ruoyi-ui/src/assets/icons/svg/client.svg
  53. 1 0
      ruoyi-ui/src/assets/icons/svg/nacos.svg
  54. 1 0
      ruoyi-ui/src/assets/icons/svg/sentinel.svg
  55. 271 0
      ruoyi-ui/src/views/system/client/index.vue
  56. 5 8
      ruoyi-ui/src/views/system/logininfor/index.vue
  57. 1 2
      ruoyi-ui/src/views/system/operlog/index.vue
  58. 1 1
      ruoyi-visual/pom.xml
  59. 3 3
      ruoyi-visual/ruoyi-monitor/pom.xml
  60. 62 57
      sql/ry_20200520.sql
  61. 5 4
      sql/ry_config_20200604.sql

+ 7 - 2
README.md

@@ -2,7 +2,8 @@
2 2
 
3 3
 * 采用前后端分离的模式,微服务版本前端(基于 [RuoYi-Vue](https://gitee.com/y_project/RuoYi-Vue))。
4 4
 * 后端采用Spring Boot、Spring Cloud & Alibaba。
5
-* 注册中心、配置中心选型Nacos,为权限认证使用OAuth2。
5
+* 注册中心、配置中心选型Nacos,权限认证使用OAuth2。
6
+* 流量控制框架选型Sentinel。
6 7
 * 感谢[ruoyi-cloud-design](https://gitee.com/zhangmrit/ruoyi-cloud),[pig](https://gitee.com/log4j/pig)。
7 8
 * 如需不分离应用,请移步 [RuoYi](https://gitee.com/y_project/RuoYi),如需分离应用,请移步 [RuoYi-Vue](https://gitee.com/y_project/RuoYi-Vue)
8 9
 * 阿里云优惠券:[点我进入](https://www.aliyun.com/minisite/goods?userCode=brki8iof&share_source=copy_link),腾讯云优惠券:[点我领取](https://cloud.tencent.com/redirect.php?redirect=1025&cps_key=198c8df2ed259157187173bc7f4f32fd&from=console)  
@@ -96,8 +97,12 @@ com.ruoyi
96 97
         <td><img src="https://oscimg.oschina.net/oscnet/up-f1fd681cc9d295db74e85ad6d2fe4389454.png"/></td>
97 98
         <td><img src="https://oscimg.oschina.net/oscnet/up-c195234bbcd30be6927f037a6755e6ab69c.png"/></td>
98 99
     </tr>
100
+	<tr>
101
+        <td><img src="https://oscimg.oschina.net/oscnet/up-ece3fd37a3d4bb75a3926e905a3c5629055.png"/></td>
102
+        <td><img src="https://oscimg.oschina.net/oscnet/up-92ffb7f3835855cff100fa0f754a6be0d99.png"/></td>
103
+    </tr>
99 104
     <tr>
100
-        <td><img src="https://oscimg.oschina.net/oscnet/b6115bc8c31de52951982e509930b20684a.jpg"/></td>
105
+        <td><img src="https://oscimg.oschina.net/oscnet/up-d69a19493e5aff7ecdd5d02410862bcea40.png"/></td>
101 106
         <td><img src="https://oscimg.oschina.net/oscnet/up-6d73c2140ce694e3de4c05035fdc1868d4c.png"/></td>
102 107
     </tr>
103 108
 </table>

+ 3 - 11
pom.xml

@@ -6,14 +6,14 @@
6 6
 
7 7
     <groupId>com.ruoyi</groupId>
8 8
     <artifactId>ruoyi</artifactId>
9
-    <version>1.0.0</version>
9
+    <version>2.0.0</version>
10 10
 
11 11
     <name>ruoyi</name>
12 12
     <url>http://www.ruoyi.vip</url>
13 13
     <description>若依微服务系统</description>
14 14
 
15 15
     <properties>
16
-        <ruoyi.version>1.0.0</ruoyi.version>
16
+        <ruoyi.version>2.0.0</ruoyi.version>
17 17
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
18 18
         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
19 19
         <java.version>1.8</java.version>
@@ -31,7 +31,6 @@
31 31
         <fastjson.version>1.2.70</fastjson.version>
32 32
 		<poi.version>3.17</poi.version>
33 33
         <common-pool.version>2.6.2</common-pool.version>
34
-		<bitwalker.version>1.19</bitwalker.version>
35 34
     </properties>
36 35
 
37 36
     <!-- 依赖声明 -->
@@ -51,7 +50,7 @@
51 50
             <dependency>
52 51
                 <groupId>com.alibaba.cloud</groupId>
53 52
                 <artifactId>spring-cloud-alibaba-dependencies</artifactId>
54
-                <version>2.1.0.RELEASE</version>
53
+                <version>2.2.1.RELEASE</version>
55 54
                 <type>pom</type>
56 55
                 <scope>import</scope>
57 56
             </dependency>
@@ -146,13 +145,6 @@
146 145
                 <artifactId>commons-pool2</artifactId>
147 146
                 <version>${common-pool.version}</version>
148 147
             </dependency>
149
-			
150
-            <!-- 解析客户端操作系统、浏览器等 -->
151
-            <dependency>
152
-                <groupId>eu.bitwalker</groupId>
153
-                <artifactId>UserAgentUtils</artifactId>
154
-                <version>${bitwalker.version}</version>
155
-            </dependency>
156 148
 
157 149
             <!-- 核心模块 -->
158 150
 	        <dependency>

+ 1 - 1
ruoyi-api/pom.xml

@@ -4,7 +4,7 @@
4 4
     <parent>
5 5
         <groupId>com.ruoyi</groupId>
6 6
         <artifactId>ruoyi</artifactId>
7
-        <version>1.0.0</version>
7
+        <version>2.0.0</version>
8 8
     </parent>
9 9
     <modelVersion>4.0.0</modelVersion>
10 10
 

+ 1 - 1
ruoyi-api/ruoyi-api-system/pom.xml

@@ -5,7 +5,7 @@
5 5
     <parent>
6 6
         <groupId>com.ruoyi</groupId>
7 7
         <artifactId>ruoyi-api</artifactId>
8
-        <version>1.0.0</version>
8
+        <version>2.0.0</version>
9 9
     </parent>
10 10
     <modelVersion>4.0.0</modelVersion>
11 11
     

+ 13 - 1
ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/RemoteLogService.java

@@ -3,6 +3,7 @@ package com.ruoyi.system.api;
3 3
 import org.springframework.cloud.openfeign.FeignClient;
4 4
 import org.springframework.web.bind.annotation.PostMapping;
5 5
 import org.springframework.web.bind.annotation.RequestBody;
6
+import org.springframework.web.bind.annotation.RequestParam;
6 7
 import com.ruoyi.common.core.constant.ServiceNameConstants;
7 8
 import com.ruoyi.common.core.domain.R;
8 9
 import com.ruoyi.system.api.domain.SysOperLog;
@@ -20,9 +21,20 @@ public interface RemoteLogService
20 21
      * 保存系统日志
21 22
      *
22 23
      * @param sysOperLog 日志实体
23
-     * @param from 内部调用标志
24 24
      * @return 结果
25 25
      */
26 26
     @PostMapping("/operlog")
27 27
     R<Boolean> saveLog(@RequestBody SysOperLog sysOperLog);
28
+
29
+    /**
30
+     * 保存访问记录
31
+     *
32
+     * @param username 用户名称
33
+     * @param status 状态
34
+     * @param message 消息
35
+     * @return 结果
36
+     */
37
+    @PostMapping("/logininfor")
38
+    R<Boolean> saveLogininfor(@RequestParam("username") String username, @RequestParam("status") String status,
39
+            @RequestParam("message") String message);
28 40
 }

+ 0 - 1
ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/RemoteUserService.java

@@ -20,7 +20,6 @@ public interface RemoteUserService
20 20
      * 通过用户名查询用户信息
21 21
      *
22 22
      * @param username 用户名
23
-     * @param from 调用标志
24 23
      * @return 结果
25 24
      */
26 25
     @GetMapping(value = "/user/info/{username}")

+ 0 - 14
ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/SysOperLog.java

@@ -58,10 +58,6 @@ public class SysOperLog extends BaseEntity
58 58
     @Excel(name = "操作地址")
59 59
     private String operIp;
60 60
 
61
-    /** 操作地点 */
62
-    @Excel(name = "操作地点")
63
-    private String operLocation;
64
-
65 61
     /** 请求参数 */
66 62
     @Excel(name = "请求参数")
67 63
     private String operParam;
@@ -193,16 +189,6 @@ public class SysOperLog extends BaseEntity
193 189
         this.operIp = operIp;
194 190
     }
195 191
 
196
-    public String getOperLocation()
197
-    {
198
-        return operLocation;
199
-    }
200
-
201
-    public void setOperLocation(String operLocation)
202
-    {
203
-        this.operLocation = operLocation;
204
-    }
205
-
206 192
     public String getOperParam()
207 193
     {
208 194
         return operParam;

+ 7 - 0
ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/factory/RemoteLogFallbackFactory.java

@@ -29,6 +29,13 @@ public class RemoteLogFallbackFactory implements FallbackFactory<RemoteLogServic
29 29
             {
30 30
                 return null;
31 31
             }
32
+
33
+            @Override
34
+            public R<Boolean> saveLogininfor(String username, String status, String message)
35
+            {
36
+                return null;
37
+            }
32 38
         };
39
+
33 40
     }
34 41
 }

+ 1 - 1
ruoyi-auth/pom.xml

@@ -4,7 +4,7 @@
4 4
     <parent>
5 5
         <groupId>com.ruoyi</groupId>
6 6
         <artifactId>ruoyi</artifactId>
7
-        <version>1.0.0</version>
7
+        <version>2.0.0</version>
8 8
     </parent>
9 9
     <modelVersion>4.0.0</modelVersion>
10 10
     

+ 14 - 0
ruoyi-auth/src/main/java/com/ruoyi/auth/controller/TokenController.java

@@ -1,5 +1,6 @@
1 1
 package com.ruoyi.auth.controller;
2 2
 
3
+import java.util.Map;
3 4
 import org.springframework.beans.factory.annotation.Autowired;
4 5
 import org.springframework.http.HttpHeaders;
5 6
 import org.springframework.security.oauth2.common.OAuth2AccessToken;
@@ -9,8 +10,11 @@ import org.springframework.web.bind.annotation.DeleteMapping;
9 10
 import org.springframework.web.bind.annotation.RequestHeader;
10 11
 import org.springframework.web.bind.annotation.RequestMapping;
11 12
 import org.springframework.web.bind.annotation.RestController;
13
+import com.ruoyi.common.core.constant.Constants;
14
+import com.ruoyi.common.core.constant.SecurityConstants;
12 15
 import com.ruoyi.common.core.domain.R;
13 16
 import com.ruoyi.common.core.utils.StringUtils;
17
+import com.ruoyi.system.api.RemoteLogService;
14 18
 
15 19
 /**
16 20
  * token 控制
@@ -24,6 +28,9 @@ public class TokenController
24 28
     @Autowired
25 29
     private TokenStore tokenStore;
26 30
 
31
+    @Autowired
32
+    private RemoteLogService remoteLogService;
33
+
27 34
     @DeleteMapping("/logout")
28 35
     public R<?> logout(@RequestHeader(value = HttpHeaders.AUTHORIZATION, required = false) String authHeader)
29 36
     {
@@ -45,6 +52,13 @@ public class TokenController
45 52
         // 清空 refresh token
46 53
         OAuth2RefreshToken refreshToken = accessToken.getRefreshToken();
47 54
         tokenStore.removeRefreshToken(refreshToken);
55
+        Map<String, ?> map = accessToken.getAdditionalInformation();
56
+        if (map.containsKey(SecurityConstants.DETAILS_USERNAME))
57
+        {
58
+            String username = (String) map.get(SecurityConstants.DETAILS_USERNAME);
59
+            // 记录用户退出日志
60
+            remoteLogService.saveLogininfor(username, Constants.LOGOUT, "退出成功");
61
+        }
48 62
         return R.ok();
49 63
     }
50 64
 }

+ 39 - 0
ruoyi-auth/src/main/java/com/ruoyi/auth/handler/AuthenticationSuccessEventHandler.java

@@ -0,0 +1,39 @@
1
+package com.ruoyi.auth.handler;
2
+
3
+import org.springframework.beans.factory.annotation.Autowired;
4
+import org.springframework.context.ApplicationListener;
5
+import org.springframework.security.authentication.event.AuthenticationSuccessEvent;
6
+import org.springframework.security.core.Authentication;
7
+import org.springframework.stereotype.Component;
8
+import com.ruoyi.common.core.constant.Constants;
9
+import com.ruoyi.common.core.utils.StringUtils;
10
+import com.ruoyi.common.security.domain.LoginUser;
11
+import com.ruoyi.system.api.RemoteLogService;
12
+
13
+/**
14
+ * 认证成功处理
15
+ * 
16
+ * @author ruoyi
17
+ */
18
+@Component
19
+public class AuthenticationSuccessEventHandler implements ApplicationListener<AuthenticationSuccessEvent>
20
+{
21
+    @Autowired
22
+    private RemoteLogService remoteLogService;
23
+
24
+    @Override
25
+    public void onApplicationEvent(AuthenticationSuccessEvent event)
26
+    {
27
+        Authentication authentication = (Authentication) event.getSource();
28
+        if (StringUtils.isNotEmpty(authentication.getAuthorities())
29
+                && authentication.getPrincipal() instanceof LoginUser)
30
+        {
31
+            LoginUser user = (LoginUser) authentication.getPrincipal();
32
+
33
+            String username = user.getUsername();
34
+
35
+            // 记录用户登录日志
36
+            remoteLogService.saveLogininfor(username, Constants.LOGIN_SUCCESS, "登录成功");
37
+        }
38
+    }
39
+}

+ 1 - 1
ruoyi-common/pom.xml

@@ -4,7 +4,7 @@
4 4
     <parent>
5 5
         <groupId>com.ruoyi</groupId>
6 6
         <artifactId>ruoyi</artifactId>
7
-        <version>1.0.0</version>
7
+        <version>2.0.0</version>
8 8
     </parent>
9 9
     <modelVersion>4.0.0</modelVersion>
10 10
 

+ 1 - 1
ruoyi-common/ruoyi-common-core/pom.xml

@@ -5,7 +5,7 @@
5 5
     <parent>
6 6
         <groupId>com.ruoyi</groupId>
7 7
         <artifactId>ruoyi-common</artifactId>
8
-        <version>1.0.0</version>
8
+        <version>2.0.0</version>
9 9
     </parent>
10 10
     <modelVersion>4.0.0</modelVersion>
11 11
 

+ 5 - 0
ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/Constants.java

@@ -13,6 +13,11 @@ public class Constants
13 13
     public static final String UTF8 = "UTF-8";
14 14
 
15 15
     /**
16
+     * GBK 字符集
17
+     */
18
+    public static final String GBK = "GBK";
19
+
20
+    /**
16 21
      * http请求
17 22
      */
18 23
     public static final String HTTP = "http://";

+ 1 - 0
ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/constant/SecurityConstants.java

@@ -16,6 +16,7 @@ public class SecurityConstants
16 16
      * 授权token url
17 17
      */
18 18
     public static final String AUTH_TOKEN = "/oauth/token";
19
+
19 20
     /**
20 21
      * 注销token url
21 22
      */

+ 1 - 1
ruoyi-common/ruoyi-common-datascope/pom.xml

@@ -5,7 +5,7 @@
5 5
     <parent>
6 6
         <groupId>com.ruoyi</groupId>
7 7
         <artifactId>ruoyi-common</artifactId>
8
-        <version>1.0.0</version>
8
+        <version>2.0.0</version>
9 9
     </parent>
10 10
     <modelVersion>4.0.0</modelVersion>
11 11
     

+ 1 - 7
ruoyi-common/ruoyi-common-log/pom.xml

@@ -5,7 +5,7 @@
5 5
     <parent>
6 6
         <groupId>com.ruoyi</groupId>
7 7
         <artifactId>ruoyi-common</artifactId>
8
-        <version>1.0.0</version>
8
+        <version>2.0.0</version>
9 9
     </parent>
10 10
     <modelVersion>4.0.0</modelVersion>
11 11
     
@@ -23,11 +23,5 @@
23 23
             <artifactId>ruoyi-common-security</artifactId>
24 24
         </dependency>
25 25
         
26
-        <!-- Bitwalker -->
27
-        <dependency>
28
-            <groupId>eu.bitwalker</groupId>
29
-            <artifactId>UserAgentUtils</artifactId>
30
-        </dependency>
31
-        
32 26
     </dependencies>
33 27
 </project>

+ 1 - 1
ruoyi-common/ruoyi-common-redis/pom.xml

@@ -5,7 +5,7 @@
5 5
     <parent>
6 6
         <groupId>com.ruoyi</groupId>
7 7
         <artifactId>ruoyi-common</artifactId>
8
-        <version>1.0.0</version>
8
+        <version>2.0.0</version>
9 9
     </parent>
10 10
     <modelVersion>4.0.0</modelVersion>
11 11
     

+ 0 - 2
ruoyi-common/ruoyi-common-redis/src/main/java/com/ruoyi/common/redis/configure/RedisConfig.java

@@ -1,6 +1,5 @@
1 1
 package com.ruoyi.common.redis.configure;
2 2
 
3
-import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
4 3
 import org.springframework.cache.annotation.CachingConfigurerSupport;
5 4
 import org.springframework.cache.annotation.EnableCaching;
6 5
 import org.springframework.context.annotation.Bean;
@@ -22,7 +21,6 @@ import com.fasterxml.jackson.databind.ObjectMapper;
22 21
 public class RedisConfig extends CachingConfigurerSupport
23 22
 {
24 23
     @Bean
25
-    @ConditionalOnMissingBean(name = "redisTemplate")
26 24
     @SuppressWarnings(value = { "unchecked", "rawtypes", "deprecation" })
27 25
     public RedisTemplate<Object, Object> redisTemplate(RedisConnectionFactory connectionFactory)
28 26
     {

+ 1 - 1
ruoyi-common/ruoyi-common-security/pom.xml

@@ -4,7 +4,7 @@
4 4
     <parent>
5 5
         <groupId>com.ruoyi</groupId>
6 6
         <artifactId>ruoyi-common</artifactId>
7
-        <version>1.0.0</version>
7
+        <version>2.0.0</version>
8 8
     </parent>
9 9
     <modelVersion>4.0.0</modelVersion>
10 10
     

+ 0 - 1
ruoyi-common/ruoyi-common-security/src/main/java/com/ruoyi/common/security/config/SecurityImportBeanDefinitionRegistrar.java

@@ -20,6 +20,5 @@ public class SecurityImportBeanDefinitionRegistrar implements ImportBeanDefiniti
20 20
         String beanName = StringUtils.uncapitalize(aClass.getSimpleName());
21 21
         BeanDefinitionBuilder beanDefinitionBuilder = BeanDefinitionBuilder.genericBeanDefinition(ResourceServerConfig.class);
22 22
         registry.registerBeanDefinition(beanName, beanDefinitionBuilder.getBeanDefinition());
23
-
24 23
     }
25 24
 }

+ 1 - 1
ruoyi-common/ruoyi-common-swagger/pom.xml

@@ -5,7 +5,7 @@
5 5
     <parent>
6 6
         <groupId>com.ruoyi</groupId>
7 7
         <artifactId>ruoyi-common</artifactId>
8
-        <version>1.0.0</version>
8
+        <version>2.0.0</version>
9 9
     </parent>
10 10
     <modelVersion>4.0.0</modelVersion>
11 11
     

+ 33 - 15
ruoyi-gateway/pom.xml

@@ -4,54 +4,72 @@
4 4
     <parent>
5 5
         <groupId>com.ruoyi</groupId>
6 6
         <artifactId>ruoyi</artifactId>
7
-        <version>1.0.0</version>
7
+        <version>2.0.0</version>
8 8
     </parent>
9 9
     <modelVersion>4.0.0</modelVersion>
10
-    
10
+
11 11
     <artifactId>ruoyi-gateway</artifactId>
12
-	
12
+
13 13
     <description>
14 14
         ruoyi-gateway网关模块
15 15
     </description>
16
-	
16
+
17 17
     <dependencies>
18
-        
19
-        <!-- SpringCloud Gateway-->
18
+
19
+        <!-- SpringCloud Gateway -->
20 20
         <dependency>
21 21
             <groupId>org.springframework.cloud</groupId>
22 22
             <artifactId>spring-cloud-starter-gateway</artifactId>
23 23
         </dependency>
24
-        
24
+
25 25
         <!-- SpringCloud Ailibaba Nacos -->
26 26
         <dependency>
27 27
             <groupId>com.alibaba.cloud</groupId>
28 28
             <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
29 29
         </dependency>
30
-        
30
+
31 31
         <!-- SpringCloud Ailibaba Nacos Config -->
32 32
         <dependency>
33 33
             <groupId>com.alibaba.cloud</groupId>
34 34
             <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
35 35
         </dependency>
36
-        
36
+
37
+        <!-- SpringCloud Ailibaba Sentinel -->
38
+        <dependency>
39
+            <groupId>com.alibaba.cloud</groupId>
40
+            <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
41
+        </dependency>
42
+
43
+        <!-- SpringCloud Ailibaba Sentinel Gateway -->
44
+        <dependency>
45
+            <groupId>com.alibaba.cloud</groupId>
46
+            <artifactId>spring-cloud-alibaba-sentinel-gateway</artifactId>
47
+        </dependency>
48
+
49
+        <!-- Sentinel Datasource Nacos -->
50
+        <dependency>
51
+            <groupId>com.alibaba.csp</groupId>
52
+            <artifactId>sentinel-datasource-nacos</artifactId>
53
+        </dependency>
54
+
37 55
         <!-- SpringBoot Actuator -->
38 56
         <dependency>
39 57
             <groupId>org.springframework.boot</groupId>
40 58
             <artifactId>spring-boot-starter-actuator</artifactId>
41 59
         </dependency>
42
-        
60
+
43 61
         <!--验证码 -->
44 62
         <dependency>
45 63
             <groupId>com.github.penggle</groupId>
46 64
             <artifactId>kaptcha</artifactId>
47 65
         </dependency>
48
-        
66
+
49 67
         <!-- RuoYi Common Redis-->
50 68
         <dependency>
51 69
             <groupId>com.ruoyi</groupId>
52 70
             <artifactId>ruoyi-common-redis</artifactId>
53 71
         </dependency>
54
-        
72
+
55 73
         <!-- Swagger -->
56 74
         <dependency>
57 75
             <groupId>io.springfox</groupId>
@@ -63,9 +81,9 @@
63 81
             <artifactId>springfox-swagger2</artifactId>
64 82
             <version>${swagger.fox.version}</version>
65 83
         </dependency>
66
-        
84
+
67 85
     </dependencies>
68
-   
86
+
69 87
     <build>
70 88
         <plugins>
71 89
             <plugin>
@@ -81,5 +99,5 @@
81 99
             </plugin>
82 100
         </plugins>
83 101
     </build>
84
-   
102
+
85 103
 </project>

+ 32 - 0
ruoyi-gateway/src/main/java/com/ruoyi/gateway/config/GatewayConfig.java

@@ -0,0 +1,32 @@
1
+package com.ruoyi.gateway.config;
2
+
3
+import org.springframework.cloud.gateway.filter.GlobalFilter;
4
+import org.springframework.context.annotation.Bean;
5
+import org.springframework.context.annotation.Configuration;
6
+import org.springframework.core.Ordered;
7
+import org.springframework.core.annotation.Order;
8
+import com.alibaba.csp.sentinel.adapter.gateway.sc.SentinelGatewayFilter;
9
+import com.ruoyi.gateway.handler.SentinelFallbackHandler;
10
+
11
+/**
12
+ * 网关限流配置
13
+ * 
14
+ * @author ruoyi
15
+ */
16
+@Configuration
17
+public class GatewayConfig
18
+{
19
+    @Bean
20
+    @Order(Ordered.HIGHEST_PRECEDENCE)
21
+    public SentinelFallbackHandler sentinelGatewayExceptionHandler()
22
+    {
23
+        return new SentinelFallbackHandler();
24
+    }
25
+
26
+    @Bean
27
+    @Order(-1)
28
+    public GlobalFilter sentinelGatewayFilter()
29
+    {
30
+        return new SentinelGatewayFilter();
31
+    }
32
+}

+ 4 - 11
ruoyi-gateway/src/main/java/com/ruoyi/gateway/config/RouterFunctionConfiguration.java

@@ -7,7 +7,6 @@ import org.springframework.http.MediaType;
7 7
 import org.springframework.web.reactive.function.server.RequestPredicates;
8 8
 import org.springframework.web.reactive.function.server.RouterFunction;
9 9
 import org.springframework.web.reactive.function.server.RouterFunctions;
10
-import com.ruoyi.gateway.handler.HystrixFallbackHandler;
11 10
 import com.ruoyi.gateway.handler.ValidateCodeHandler;
12 11
 
13 12
 /**
@@ -19,20 +18,14 @@ import com.ruoyi.gateway.handler.ValidateCodeHandler;
19 18
 public class RouterFunctionConfiguration
20 19
 {
21 20
     @Autowired
22
-    private HystrixFallbackHandler hystrixFallbackHandler;
23
-
24
-    @Autowired
25
-    private ValidateCodeHandler imageCodeHandler;
21
+    private ValidateCodeHandler validateCodeHandler;
26 22
 
27 23
     @SuppressWarnings("rawtypes")
28 24
     @Bean
29 25
     public RouterFunction routerFunction()
30 26
     {
31
-        return RouterFunctions
32
-                .route(RequestPredicates.path("/fallback").and(RequestPredicates.accept(MediaType.TEXT_PLAIN)),
33
-                        hystrixFallbackHandler)
34
-                .andRoute(RequestPredicates.GET("/code").and(RequestPredicates.accept(MediaType.TEXT_PLAIN)),
35
-                        imageCodeHandler);
27
+        return RouterFunctions.route(
28
+                RequestPredicates.GET("/code").and(RequestPredicates.accept(MediaType.TEXT_PLAIN)),
29
+                validateCodeHandler);
36 30
     }
37
-
38 31
 }

+ 0 - 36
ruoyi-gateway/src/main/java/com/ruoyi/gateway/handler/HystrixFallbackHandler.java

@@ -1,36 +0,0 @@
1
-package com.ruoyi.gateway.handler;
2
-
3
-import com.alibaba.fastjson.JSON;
4
-import com.ruoyi.common.core.domain.R;
5
-import org.slf4j.Logger;
6
-import org.slf4j.LoggerFactory;
7
-import org.springframework.http.HttpStatus;
8
-import org.springframework.http.MediaType;
9
-import org.springframework.stereotype.Component;
10
-import org.springframework.web.reactive.function.BodyInserters;
11
-import org.springframework.web.reactive.function.server.HandlerFunction;
12
-import org.springframework.web.reactive.function.server.ServerRequest;
13
-import org.springframework.web.reactive.function.server.ServerResponse;
14
-import reactor.core.publisher.Mono;
15
-import java.util.Optional;
16
-import static org.springframework.cloud.gateway.support.ServerWebExchangeUtils.GATEWAY_ORIGINAL_REQUEST_URL_ATTR;
17
-
18
-/**
19
- * 熔断降级处理
20
- * 
21
- * @author ruoyi
22
- */
23
-@Component
24
-public class HystrixFallbackHandler implements HandlerFunction<ServerResponse>
25
-{
26
-    private static final Logger log = LoggerFactory.getLogger(HystrixFallbackHandler.class);
27
-    
28
-    @Override
29
-    public Mono<ServerResponse> handle(ServerRequest serverRequest)
30
-    {
31
-        Optional<Object> originalUris = serverRequest.attribute(GATEWAY_ORIGINAL_REQUEST_URL_ATTR);
32
-        originalUris.ifPresent(originalUri -> log.error("网关执行请求:{}失败,hystrix服务降级处理", originalUri));
33
-        return ServerResponse.status(HttpStatus.INTERNAL_SERVER_ERROR.value()).contentType(MediaType.APPLICATION_JSON)
34
-                .body(BodyInserters.fromValue(JSON.toJSONString(R.failed("服务已被降级熔断"))));
35
-    }
36
-}

+ 47 - 0
ruoyi-gateway/src/main/java/com/ruoyi/gateway/handler/SentinelFallbackHandler.java

@@ -0,0 +1,47 @@
1
+package com.ruoyi.gateway.handler;
2
+
3
+import java.nio.charset.StandardCharsets;
4
+import com.alibaba.csp.sentinel.adapter.gateway.sc.callback.GatewayCallbackManager;
5
+import com.alibaba.csp.sentinel.slots.block.BlockException;
6
+import org.springframework.core.io.buffer.DataBuffer;
7
+import org.springframework.http.server.reactive.ServerHttpResponse;
8
+import org.springframework.web.reactive.function.server.ServerResponse;
9
+import org.springframework.web.server.ServerWebExchange;
10
+import org.springframework.web.server.WebExceptionHandler;
11
+import reactor.core.publisher.Mono;
12
+
13
+/**
14
+ * 自定义限流异常处理
15
+ * 
16
+ * @author ruoyi
17
+ */
18
+public class SentinelFallbackHandler implements WebExceptionHandler
19
+{
20
+    private Mono<Void> writeResponse(ServerResponse response, ServerWebExchange exchange)
21
+    {
22
+        ServerHttpResponse serverHttpResponse = exchange.getResponse();
23
+        serverHttpResponse.getHeaders().add("Content-Type", "application/json;charset=UTF-8");
24
+        byte[] datas = "{\"status\":429,\"message\":\"请求超过最大数,请稍后再试\"}".getBytes(StandardCharsets.UTF_8);
25
+        DataBuffer buffer = serverHttpResponse.bufferFactory().wrap(datas);
26
+        return serverHttpResponse.writeWith(Mono.just(buffer));
27
+    }
28
+
29
+    @Override
30
+    public Mono<Void> handle(ServerWebExchange exchange, Throwable ex)
31
+    {
32
+        if (exchange.getResponse().isCommitted())
33
+        {
34
+            return Mono.error(ex);
35
+        }
36
+        if (!BlockException.isBlockException(ex))
37
+        {
38
+            return Mono.error(ex);
39
+        }
40
+        return handleBlockedRequest(exchange, ex).flatMap(response -> writeResponse(response, exchange));
41
+    }
42
+
43
+    private Mono<ServerResponse> handleBlockedRequest(ServerWebExchange exchange, Throwable throwable)
44
+    {
45
+        return GatewayCallbackManager.getBlockHandler().handleRequest(exchange, throwable);
46
+    }
47
+}

+ 0 - 3
ruoyi-gateway/src/main/java/com/ruoyi/gateway/service/impl/ValidateCodeServiceImpl.java

@@ -3,13 +3,10 @@ package com.ruoyi.gateway.service.impl;
3 3
 import java.awt.image.BufferedImage;
4 4
 import java.io.IOException;
5 5
 import java.util.concurrent.TimeUnit;
6
-
7 6
 import javax.imageio.ImageIO;
8
-
9 7
 import org.springframework.beans.factory.annotation.Autowired;
10 8
 import org.springframework.stereotype.Service;
11 9
 import org.springframework.util.FastByteArrayOutputStream;
12
-
13 10
 import com.google.code.kaptcha.Producer;
14 11
 import com.ruoyi.common.core.constant.Constants;
15 12
 import com.ruoyi.common.core.exception.CaptchaException;

+ 17 - 0
ruoyi-gateway/src/main/resources/bootstrap.yml

@@ -10,6 +10,8 @@ spring:
10 10
   profiles:
11 11
     # 环境配置
12 12
     active: dev
13
+  main:
14
+    allow-bean-definition-overriding: true
13 15
   cloud:
14 16
     nacos:
15 17
       discovery:
@@ -22,3 +24,18 @@ spring:
22 24
         file-extension: yml
23 25
         # 共享配置
24 26
         shared-dataids: application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
27
+    sentinel:
28
+      # 取消控制台懒加载
29
+      eager: true
30
+      transport:
31
+        # 控制台地址
32
+        dashboard: 127.0.0.1:8718
33
+      # nacos配置持久化
34
+      datasource:
35
+        ds1:
36
+          nacos:
37
+            server-addr: 127.0.0.1:8848
38
+            dataId: sentinel-ruoyi-gateway
39
+            groupId: DEFAULT_GROUP
40
+            data-type: json
41
+            rule-type: flow

+ 1 - 1
ruoyi-modules/pom.xml

@@ -4,7 +4,7 @@
4 4
     <parent>
5 5
         <groupId>com.ruoyi</groupId>
6 6
         <artifactId>ruoyi</artifactId>
7
-        <version>1.0.0</version>
7
+        <version>2.0.0</version>
8 8
     </parent>
9 9
     <modelVersion>4.0.0</modelVersion>
10 10
 

+ 4 - 4
ruoyi-modules/ruoyi-gen/pom.xml

@@ -5,7 +5,7 @@
5 5
     <parent>
6 6
         <groupId>com.ruoyi</groupId>
7 7
         <artifactId>ruoyi-modules</artifactId>
8
-        <version>1.0.0</version>
8
+        <version>2.0.0</version>
9 9
     </parent>
10 10
     <modelVersion>4.0.0</modelVersion>
11 11
 
@@ -29,10 +29,10 @@
29 29
             <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
30 30
         </dependency>
31 31
         
32
-        <!-- SpringCloud Netflix Hystrix -->
32
+        <!-- SpringCloud Ailibaba Sentinel -->
33 33
         <dependency>
34
-            <groupId>org.springframework.cloud</groupId>
35
-            <artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
34
+            <groupId>com.alibaba.cloud</groupId>
35
+            <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
36 36
         </dependency>
37 37
         
38 38
         <!-- SpringBoot Web -->

+ 1 - 1
ruoyi-modules/ruoyi-gen/src/main/java/com/ruoyi/gen/util/VelocityUtils.java

@@ -22,7 +22,7 @@ public class VelocityUtils
22 22
     private static final String PROJECT_PATH = "main/java";
23 23
 
24 24
     /** mybatis空间路径 */
25
-    private static final String MYBATIS_PATH = "main/resources/mybatis";
25
+    private static final String MYBATIS_PATH = "main/resources/mapper";
26 26
 
27 27
     /**
28 28
      * 设置模板变量信息

+ 11 - 9
ruoyi-modules/ruoyi-gen/src/main/resources/vm/java/controller.java.vm

@@ -1,6 +1,8 @@
1 1
 package ${packageName}.controller;
2 2
 
3 3
 import java.util.List;
4
+import java.io.IOException;
5
+import javax.servlet.http.HttpServletResponse;
4 6
 import org.springframework.security.access.prepost.PreAuthorize;
5 7
 import org.springframework.beans.factory.annotation.Autowired;
6 8
 import org.springframework.web.bind.annotation.GetMapping;
@@ -11,15 +13,15 @@ import org.springframework.web.bind.annotation.PathVariable;
11 13
 import org.springframework.web.bind.annotation.RequestBody;
12 14
 import org.springframework.web.bind.annotation.RequestMapping;
13 15
 import org.springframework.web.bind.annotation.RestController;
14
-import com.ruoyi.framework.aspectj.lang.annotation.Log;
15
-import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
16
+import com.ruoyi.common.log.annotation.Log;
17
+import com.ruoyi.common.log.enums.BusinessType;
16 18
 import ${packageName}.domain.${ClassName};
17 19
 import ${packageName}.service.I${ClassName}Service;
18
-import com.ruoyi.framework.web.controller.BaseController;
19
-import com.ruoyi.framework.web.domain.AjaxResult;
20
-import com.ruoyi.common.utils.poi.ExcelUtil;
20
+import com.ruoyi.common.core.web.controller.BaseController;
21
+import com.ruoyi.common.core.web.domain.AjaxResult;
22
+import com.ruoyi.common.core.utils.poi.ExcelUtil;
21 23
 #if($table.crud)
22
-import com.ruoyi.framework.web.page.TableDataInfo;
24
+import com.ruoyi.common.core.web.page.TableDataInfo;
23 25
 #elseif($table.tree)
24 26
 #end
25 27
 
@@ -30,7 +32,7 @@ import com.ruoyi.framework.web.page.TableDataInfo;
30 32
  * @date ${datetime}
31 33
  */
32 34
 @RestController
33
-@RequestMapping("/${moduleName}/${businessName}")
35
+@RequestMapping("/${businessName}")
34 36
 public class ${ClassName}Controller extends BaseController
35 37
 {
36 38
     @Autowired
@@ -62,11 +64,11 @@ public class ${ClassName}Controller extends BaseController
62 64
     @PreAuthorize("@ss.hasPermi('${permissionPrefix}:export')")
63 65
     @Log(title = "${functionName}", businessType = BusinessType.EXPORT)
64 66
     @GetMapping("/export")
65
-    public AjaxResult export(${ClassName} ${className})
67
+    public void export(HttpServletResponse response, ${ClassName} ${className}) throws IOException
66 68
     {
67 69
         List<${ClassName}> list = ${className}Service.select${ClassName}List(${className});
68 70
         ExcelUtil<${ClassName}> util = new ExcelUtil<${ClassName}>(${ClassName}.class);
69
-        return util.exportExcel(list, "${businessName}");
71
+        return util.exportExcel(response, list, "${businessName}");
70 72
     }
71 73
 
72 74
     /**

+ 0 - 9
ruoyi-modules/ruoyi-gen/src/main/resources/vm/js/api.js.vm

@@ -42,12 +42,3 @@ export function del${BusinessName}(${pkColumn.javaField}) {
42 42
     method: 'delete'
43 43
   })
44 44
 }
45
-
46
-// 导出${functionName}
47
-export function export${BusinessName}(query) {
48
-  return request({
49
-    url: '/${moduleName}/${businessName}/export',
50
-    method: 'get',
51
-    params: query
52
-  })
53
-}

+ 4 - 11
ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index.vue.vm

@@ -229,7 +229,7 @@
229 229
 </template>
230 230
 
231 231
 <script>
232
-import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName}, export${BusinessName} } from "@/api/${moduleName}/${businessName}";
232
+import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}";
233 233
 
234 234
 export default {
235 235
   name: "${BusinessName}",
@@ -422,16 +422,9 @@ export default {
422 422
     },
423 423
     /** 导出按钮操作 */
424 424
     handleExport() {
425
-      const queryParams = this.queryParams;
426
-      this.$confirm('是否确认导出所有${functionName}数据项?', "警告", {
427
-          confirmButtonText: "确定",
428
-          cancelButtonText: "取消",
429
-          type: "warning"
430
-        }).then(function() {
431
-          return export${BusinessName}(queryParams);
432
-        }).then(response => {
433
-          this.download(response.msg);
434
-        }).catch(function() {});
425
+      this.download('${moduleName}/${businessName}/export', {
426
+        ...this.queryParams
427
+      }, `${moduleName}_${businessName}.xlsx`)
435 428
     }
436 429
   }
437 430
 };

+ 4 - 4
ruoyi-modules/ruoyi-job/pom.xml

@@ -5,7 +5,7 @@
5 5
     <parent>
6 6
         <groupId>com.ruoyi</groupId>
7 7
         <artifactId>ruoyi-modules</artifactId>
8
-        <version>1.0.0</version>
8
+        <version>2.0.0</version>
9 9
     </parent>
10 10
     <modelVersion>4.0.0</modelVersion>
11 11
 
@@ -29,10 +29,10 @@
29 29
             <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
30 30
         </dependency>
31 31
         
32
-        <!-- SpringCloud Netflix Hystrix -->
32
+        <!-- SpringCloud Ailibaba Sentinel -->
33 33
         <dependency>
34
-            <groupId>org.springframework.cloud</groupId>
35
-            <artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
34
+            <groupId>com.alibaba.cloud</groupId>
35
+            <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
36 36
         </dependency>
37 37
         
38 38
         <!-- SpringBoot Web -->

+ 4 - 4
ruoyi-modules/ruoyi-system/pom.xml

@@ -5,7 +5,7 @@
5 5
     <parent>
6 6
         <groupId>com.ruoyi</groupId>
7 7
         <artifactId>ruoyi-modules</artifactId>
8
-        <version>1.0.0</version>
8
+        <version>2.0.0</version>
9 9
     </parent>
10 10
     <modelVersion>4.0.0</modelVersion>
11 11
 	
@@ -29,10 +29,10 @@
29 29
             <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
30 30
         </dependency>
31 31
         
32
-    	<!-- SpringCloud Netflix Hystrix -->
32
+    	<!-- SpringCloud Ailibaba Sentinel -->
33 33
         <dependency>
34
-            <groupId>org.springframework.cloud</groupId>
35
-            <artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
34
+            <groupId>com.alibaba.cloud</groupId>
35
+            <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
36 36
         </dependency>
37 37
         
38 38
     	<!-- SpringBoot Web -->

+ 94 - 0
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysClientDetailsController.java

@@ -0,0 +1,94 @@
1
+package com.ruoyi.system.controller;
2
+
3
+import java.util.List;
4
+import org.springframework.beans.factory.annotation.Autowired;
5
+import org.springframework.security.access.prepost.PreAuthorize;
6
+import org.springframework.web.bind.annotation.DeleteMapping;
7
+import org.springframework.web.bind.annotation.GetMapping;
8
+import org.springframework.web.bind.annotation.PathVariable;
9
+import org.springframework.web.bind.annotation.PostMapping;
10
+import org.springframework.web.bind.annotation.PutMapping;
11
+import org.springframework.web.bind.annotation.RequestBody;
12
+import org.springframework.web.bind.annotation.RequestMapping;
13
+import org.springframework.web.bind.annotation.RestController;
14
+import com.ruoyi.common.core.utils.StringUtils;
15
+import com.ruoyi.common.core.web.controller.BaseController;
16
+import com.ruoyi.common.core.web.domain.AjaxResult;
17
+import com.ruoyi.common.core.web.page.TableDataInfo;
18
+import com.ruoyi.common.log.annotation.Log;
19
+import com.ruoyi.common.log.enums.BusinessType;
20
+import com.ruoyi.system.domain.SysClientDetails;
21
+import com.ruoyi.system.service.ISysClientDetailsService;
22
+
23
+/**
24
+ * 终端配置 信息操作处理
25
+ * 
26
+ * @author ruoyi
27
+ */
28
+@RestController
29
+@RequestMapping("/client")
30
+public class SysClientDetailsController extends BaseController
31
+{
32
+    @Autowired
33
+    private ISysClientDetailsService sysClientDetailsService;
34
+
35
+    /**
36
+     * 查询终端配置列表
37
+     */
38
+    @PreAuthorize("@ss.hasPermi('system:client:list')")
39
+    @GetMapping("/list")
40
+    public TableDataInfo list(SysClientDetails sysClientDetails)
41
+    {
42
+        startPage();
43
+        List<SysClientDetails> list = sysClientDetailsService.selectSysClientDetailsList(sysClientDetails);
44
+        return getDataTable(list);
45
+    }
46
+
47
+    /**
48
+     * 获取终端配置详细信息
49
+     */
50
+    @PreAuthorize("@ss.hasPermi('system:client:query')")
51
+    @GetMapping(value = "/{clientId}")
52
+    public AjaxResult getInfo(@PathVariable("clientId") String clientId)
53
+    {
54
+        return AjaxResult.success(sysClientDetailsService.selectSysClientDetailsById(clientId));
55
+    }
56
+
57
+    /**
58
+     * 新增终端配置
59
+     */
60
+    @PreAuthorize("@ss.hasPermi('system:client:add')")
61
+    @Log(title = "终端配置", businessType = BusinessType.INSERT)
62
+    @PostMapping
63
+    public AjaxResult add(@RequestBody SysClientDetails sysClientDetails)
64
+    {
65
+        String clientId = sysClientDetails.getClientId();
66
+        if (StringUtils.isNotNull(sysClientDetailsService.selectSysClientDetailsById(clientId)))
67
+        {
68
+            return AjaxResult.error("新增终端'" + clientId + "'失败,编号已存在");
69
+        }
70
+        return toAjax(sysClientDetailsService.insertSysClientDetails(sysClientDetails));
71
+    }
72
+
73
+    /**
74
+     * 修改终端配置
75
+     */
76
+    @PreAuthorize("@ss.hasPermi('system:client:edit')")
77
+    @Log(title = "终端配置", businessType = BusinessType.UPDATE)
78
+    @PutMapping
79
+    public AjaxResult edit(@RequestBody SysClientDetails sysClientDetails)
80
+    {
81
+        return toAjax(sysClientDetailsService.updateSysClientDetails(sysClientDetails));
82
+    }
83
+
84
+    /**
85
+     * 删除终端配置
86
+     */
87
+    @PreAuthorize("@ss.hasPermi('system:client:remove')")
88
+    @Log(title = "终端配置", businessType = BusinessType.DELETE)
89
+    @DeleteMapping("/{clientIds}")
90
+    public AjaxResult remove(@PathVariable String[] clientIds)
91
+    {
92
+        return toAjax(sysClientDetailsService.deleteSysClientDetailsByIds(clientIds));
93
+    }
94
+}

+ 28 - 1
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/SysLogininforController.java

@@ -10,7 +10,11 @@ import org.springframework.web.bind.annotation.GetMapping;
10 10
 import org.springframework.web.bind.annotation.PathVariable;
11 11
 import org.springframework.web.bind.annotation.PostMapping;
12 12
 import org.springframework.web.bind.annotation.RequestMapping;
13
+import org.springframework.web.bind.annotation.RequestParam;
13 14
 import org.springframework.web.bind.annotation.RestController;
15
+import com.ruoyi.common.core.constant.Constants;
16
+import com.ruoyi.common.core.utils.ServletUtils;
17
+import com.ruoyi.common.core.utils.ip.IpUtils;
14 18
 import com.ruoyi.common.core.utils.poi.ExcelUtil;
15 19
 import com.ruoyi.common.core.web.controller.BaseController;
16 20
 import com.ruoyi.common.core.web.domain.AjaxResult;
@@ -40,7 +44,7 @@ public class SysLogininforController extends BaseController
40 44
         List<SysLogininfor> list = logininforService.selectLogininforList(logininfor);
41 45
         return getDataTable(list);
42 46
     }
43
-    
47
+
44 48
     @Log(title = "登陆日志", businessType = BusinessType.EXPORT)
45 49
     @PreAuthorize("@ss.hasPermi('system:logininfor:export')")
46 50
     @PostMapping("/export")
@@ -67,4 +71,27 @@ public class SysLogininforController extends BaseController
67 71
         logininforService.cleanLogininfor();
68 72
         return AjaxResult.success();
69 73
     }
74
+
75
+    @PostMapping
76
+    public AjaxResult add(@RequestParam("username") String username, @RequestParam("status") String status,
77
+            @RequestParam("message") String message)
78
+    {
79
+        String ip = IpUtils.getIpAddr(ServletUtils.getRequest());
80
+
81
+        // 封装对象
82
+        SysLogininfor logininfor = new SysLogininfor();
83
+        logininfor.setUserName(username);
84
+        logininfor.setIpaddr(ip);
85
+        logininfor.setMsg(message);
86
+        // 日志状态
87
+        if (Constants.LOGIN_SUCCESS.equals(status) || Constants.LOGOUT.equals(status))
88
+        {
89
+            logininfor.setStatus("0");
90
+        }
91
+        else if (Constants.LOGIN_FAIL.equals(status))
92
+        {
93
+            logininfor.setStatus("1");
94
+        }
95
+        return toAjax(logininforService.insertLogininfor(logininfor));
96
+    }
70 97
 }

+ 197 - 0
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysClientDetails.java

@@ -0,0 +1,197 @@
1
+package com.ruoyi.system.domain;
2
+
3
+import org.apache.commons.lang3.builder.ToStringBuilder;
4
+import org.apache.commons.lang3.builder.ToStringStyle;
5
+import com.ruoyi.common.core.web.domain.BaseEntity;
6
+
7
+/**
8
+ * 终端配置表 sys_oauth_client_details
9
+ *
10
+ * @author ruoyi
11
+ */
12
+public class SysClientDetails extends BaseEntity
13
+{
14
+    private static final long serialVersionUID = 1L;
15
+
16
+    /**
17
+     * 终端编号
18
+     */
19
+    private String clientId;
20
+
21
+    /**
22
+     * 资源ID标识
23
+     */
24
+    private String resourceIds;
25
+
26
+    /**
27
+     * 终端安全码
28
+     */
29
+    private String clientSecret;
30
+
31
+    /**
32
+     * 终端授权范围
33
+     */
34
+    private String scope;
35
+
36
+    /**
37
+     * 终端授权类型
38
+     */
39
+    private String authorizedGrantTypes;
40
+
41
+    /**
42
+     * 服务器回调地址
43
+     */
44
+    private String webServerRedirectUri;
45
+
46
+    /**
47
+     * 访问资源所需权限
48
+     */
49
+    private String authorities;
50
+
51
+    /**
52
+     * 设定终端的access_token的有效时间值(秒)
53
+     */
54
+    private Integer accessTokenValidity;
55
+
56
+    /**
57
+     * 设定终端的refresh_token的有效时间值(秒)
58
+     */
59
+    private Integer refreshTokenValidity;
60
+
61
+    /**
62
+     * 附加信息
63
+     */
64
+    private String additionalInformation;
65
+
66
+    /**
67
+     * 是否登录时跳过授权
68
+     */
69
+    private String autoapprove;
70
+
71
+    public String getClientId()
72
+    {
73
+        return clientId;
74
+    }
75
+
76
+    public void setClientId(String clientId)
77
+    {
78
+        this.clientId = clientId;
79
+    }
80
+
81
+    public String getResourceIds()
82
+    {
83
+        return resourceIds;
84
+    }
85
+
86
+    public void setResourceIds(String resourceIds)
87
+    {
88
+        this.resourceIds = resourceIds;
89
+    }
90
+
91
+    public String getClientSecret()
92
+    {
93
+        return clientSecret;
94
+    }
95
+
96
+    public void setClientSecret(String clientSecret)
97
+    {
98
+        this.clientSecret = clientSecret;
99
+    }
100
+
101
+    public String getScope()
102
+    {
103
+        return scope;
104
+    }
105
+
106
+    public void setScope(String scope)
107
+    {
108
+        this.scope = scope;
109
+    }
110
+
111
+    public String getAuthorizedGrantTypes()
112
+    {
113
+        return authorizedGrantTypes;
114
+    }
115
+
116
+    public void setAuthorizedGrantTypes(String authorizedGrantTypes)
117
+    {
118
+        this.authorizedGrantTypes = authorizedGrantTypes;
119
+    }
120
+
121
+    public String getWebServerRedirectUri()
122
+    {
123
+        return webServerRedirectUri;
124
+    }
125
+
126
+    public void setWebServerRedirectUri(String webServerRedirectUri)
127
+    {
128
+        this.webServerRedirectUri = webServerRedirectUri;
129
+    }
130
+
131
+    public String getAuthorities()
132
+    {
133
+        return authorities;
134
+    }
135
+
136
+    public void setAuthorities(String authorities)
137
+    {
138
+        this.authorities = authorities;
139
+    }
140
+
141
+    public Integer getAccessTokenValidity()
142
+    {
143
+        return accessTokenValidity;
144
+    }
145
+
146
+    public void setAccessTokenValidity(Integer accessTokenValidity)
147
+    {
148
+        this.accessTokenValidity = accessTokenValidity;
149
+    }
150
+
151
+    public Integer getRefreshTokenValidity()
152
+    {
153
+        return refreshTokenValidity;
154
+    }
155
+
156
+    public void setRefreshTokenValidity(Integer refreshTokenValidity)
157
+    {
158
+        this.refreshTokenValidity = refreshTokenValidity;
159
+    }
160
+
161
+    public String getAdditionalInformation()
162
+    {
163
+        return additionalInformation;
164
+    }
165
+
166
+    public void setAdditionalInformation(String additionalInformation)
167
+    {
168
+        this.additionalInformation = additionalInformation;
169
+    }
170
+
171
+    public String getAutoapprove()
172
+    {
173
+        return autoapprove;
174
+    }
175
+
176
+    public void setAutoapprove(String autoapprove)
177
+    {
178
+        this.autoapprove = autoapprove;
179
+    }
180
+
181
+    @Override
182
+    public String toString() {
183
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
184
+            .append("clientId", getClientId())
185
+            .append("resourceIds", getResourceIds())
186
+            .append("clientSecret", getClientSecret())
187
+            .append("scope", getScope())
188
+            .append("authorizedGrantTypes", getAuthorizedGrantTypes())
189
+            .append("webServerRedirectUri", getWebServerRedirectUri())
190
+            .append("authorities", getAuthorities())
191
+            .append("accessTokenValidity", getAccessTokenValidity())
192
+            .append("refreshTokenValidity", getRefreshTokenValidity())
193
+            .append("additionalInformation", getAdditionalInformation())
194
+            .append("autoapprove", getAutoapprove())
195
+            .toString();
196
+    }
197
+}

+ 11 - 53
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysLogininfor.java

@@ -23,34 +23,22 @@ public class SysLogininfor extends BaseEntity
23 23
     @Excel(name = "用户账号")
24 24
     private String userName;
25 25
 
26
-    /** 登录状态 0成功 1失败 */
27
-    @Excel(name = "登录状态", readConverterExp = "0=成功,1=失败")
26
+    /** 状态 0成功 1失败 */
27
+    @Excel(name = "状态", readConverterExp = "0=成功,1=失败")
28 28
     private String status;
29 29
 
30
-    /** 登录IP地址 */
31
-    @Excel(name = "登录地址")
30
+    /** 地址 */
31
+    @Excel(name = "地址")
32 32
     private String ipaddr;
33 33
 
34
-    /** 登录地点 */
35
-    @Excel(name = "登录地点")
36
-    private String loginLocation;
37
-
38
-    /** 浏览器类型 */
39
-    @Excel(name = "浏览器")
40
-    private String browser;
41
-
42
-    /** 操作系统 */
43
-    @Excel(name = "操作系统")
44
-    private String os;
45
-
46
-    /** 提示消息 */
47
-    @Excel(name = "提示消息")
34
+    /** 描述 */
35
+    @Excel(name = "描述")
48 36
     private String msg;
49 37
 
50 38
     /** 访问时间 */
51 39
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
52 40
     @Excel(name = "访问时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
53
-    private Date loginTime;
41
+    private Date accessTime;
54 42
 
55 43
     public Long getInfoId()
56 44
     {
@@ -92,36 +80,6 @@ public class SysLogininfor extends BaseEntity
92 80
         this.ipaddr = ipaddr;
93 81
     }
94 82
 
95
-    public String getLoginLocation()
96
-    {
97
-        return loginLocation;
98
-    }
99
-
100
-    public void setLoginLocation(String loginLocation)
101
-    {
102
-        this.loginLocation = loginLocation;
103
-    }
104
-
105
-    public String getBrowser()
106
-    {
107
-        return browser;
108
-    }
109
-
110
-    public void setBrowser(String browser)
111
-    {
112
-        this.browser = browser;
113
-    }
114
-
115
-    public String getOs()
116
-    {
117
-        return os;
118
-    }
119
-
120
-    public void setOs(String os)
121
-    {
122
-        this.os = os;
123
-    }
124
-
125 83
     public String getMsg()
126 84
     {
127 85
         return msg;
@@ -132,13 +90,13 @@ public class SysLogininfor extends BaseEntity
132 90
         this.msg = msg;
133 91
     }
134 92
 
135
-    public Date getLoginTime()
93
+    public Date getAccessTime()
136 94
     {
137
-        return loginTime;
95
+        return accessTime;
138 96
     }
139 97
 
140
-    public void setLoginTime(Date loginTime)
98
+    public void setAccessTime(Date accessTime)
141 99
     {
142
-        this.loginTime = loginTime;
100
+        this.accessTime = accessTime;
143 101
     }
144 102
 }

+ 60 - 0
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysClientDetailsMapper.java

@@ -0,0 +1,60 @@
1
+package com.ruoyi.system.mapper;
2
+
3
+import java.util.List;
4
+import com.ruoyi.system.domain.SysClientDetails;
5
+
6
+/**
7
+ * 终端配置Mapper接口
8
+ * 
9
+ * @author ruoyi
10
+ */
11
+public interface SysClientDetailsMapper
12
+{
13
+    /**
14
+     * 查询终端配置
15
+     * 
16
+     * @param clientId 终端配置ID
17
+     * @return 终端配置
18
+     */
19
+    public SysClientDetails selectSysClientDetailsById(String clientId);
20
+
21
+    /**
22
+     * 查询终端配置列表
23
+     * 
24
+     * @param sysClientDetails 终端配置
25
+     * @return 终端配置集合
26
+     */
27
+    public List<SysClientDetails> selectSysClientDetailsList(SysClientDetails sysClientDetails);
28
+
29
+    /**
30
+     * 新增终端配置
31
+     * 
32
+     * @param sysClientDetails 终端配置
33
+     * @return 结果
34
+     */
35
+    public int insertSysClientDetails(SysClientDetails sysClientDetails);
36
+
37
+    /**
38
+     * 修改终端配置
39
+     * 
40
+     * @param sysClientDetails 终端配置
41
+     * @return 结果
42
+     */
43
+    public int updateSysClientDetails(SysClientDetails sysClientDetails);
44
+
45
+    /**
46
+     * 删除终端配置
47
+     * 
48
+     * @param clientId 终端配置ID
49
+     * @return 结果
50
+     */
51
+    public int deleteSysClientDetailsById(String clientId);
52
+
53
+    /**
54
+     * 批量删除终端配置
55
+     * 
56
+     * @param clientIds 需要删除的数据ID
57
+     * @return 结果
58
+     */
59
+    public int deleteSysClientDetailsByIds(String[] clientIds);
60
+}

+ 1 - 1
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysLogininforMapper.java

@@ -15,7 +15,7 @@ public interface SysLogininforMapper
15 15
      * 
16 16
      * @param logininfor 访问日志对象
17 17
      */
18
-    public void insertLogininfor(SysLogininfor logininfor);
18
+    public int insertLogininfor(SysLogininfor logininfor);
19 19
 
20 20
     /**
21 21
      * 查询系统登录日志集合

+ 60 - 0
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysClientDetailsService.java

@@ -0,0 +1,60 @@
1
+package com.ruoyi.system.service;
2
+
3
+import java.util.List;
4
+import com.ruoyi.system.domain.SysClientDetails;
5
+
6
+/**
7
+ * 终端配置Service接口
8
+ * 
9
+ * @author ruoyi
10
+ */
11
+public interface ISysClientDetailsService
12
+{
13
+    /**
14
+     * 查询终端配置
15
+     * 
16
+     * @param clientId 终端配置ID
17
+     * @return 终端配置
18
+     */
19
+    public SysClientDetails selectSysClientDetailsById(String clientId);
20
+
21
+    /**
22
+     * 查询终端配置列表
23
+     * 
24
+     * @param sysClientDetails 终端配置
25
+     * @return 终端配置集合
26
+     */
27
+    public List<SysClientDetails> selectSysClientDetailsList(SysClientDetails sysClientDetails);
28
+
29
+    /**
30
+     * 新增终端配置
31
+     * 
32
+     * @param sysClientDetails 终端配置
33
+     * @return 结果
34
+     */
35
+    public int insertSysClientDetails(SysClientDetails sysClientDetails);
36
+
37
+    /**
38
+     * 修改终端配置
39
+     * 
40
+     * @param sysClientDetails 终端配置
41
+     * @return 结果
42
+     */
43
+    public int updateSysClientDetails(SysClientDetails sysClientDetails);
44
+
45
+    /**
46
+     * 批量删除终端配置
47
+     * 
48
+     * @param clientIds 需要删除的终端配置ID
49
+     * @return 结果
50
+     */
51
+    public int deleteSysClientDetailsByIds(String[] clientIds);
52
+
53
+    /**
54
+     * 删除终端配置信息
55
+     * 
56
+     * @param clientId 终端配置ID
57
+     * @return 结果
58
+     */
59
+    public int deleteSysClientDetailsById(String clientId);
60
+}

+ 1 - 1
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysLogininforService.java

@@ -15,7 +15,7 @@ public interface ISysLogininforService
15 15
      * 
16 16
      * @param logininfor 访问日志对象
17 17
      */
18
-    public void insertLogininfor(SysLogininfor logininfor);
18
+    public int insertLogininfor(SysLogininfor logininfor);
19 19
 
20 20
     /**
21 21
      * 查询系统登录日志集合

+ 92 - 0
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysClientDetailsServiceImpl.java

@@ -0,0 +1,92 @@
1
+package com.ruoyi.system.service.impl;
2
+
3
+import java.util.List;
4
+import org.springframework.beans.factory.annotation.Autowired;
5
+import org.springframework.stereotype.Service;
6
+import com.ruoyi.system.mapper.SysClientDetailsMapper;
7
+import com.ruoyi.system.domain.SysClientDetails;
8
+import com.ruoyi.system.service.ISysClientDetailsService;
9
+
10
+/**
11
+ * 终端配置Service业务层处理
12
+ * 
13
+ * @author ruoyi
14
+ */
15
+@Service
16
+public class SysClientDetailsServiceImpl implements ISysClientDetailsService
17
+{
18
+    @Autowired
19
+    private SysClientDetailsMapper sysClientDetailsMapper;
20
+
21
+    /**
22
+     * 查询终端配置
23
+     * 
24
+     * @param clientId 终端配置ID
25
+     * @return 终端配置
26
+     */
27
+    @Override
28
+    public SysClientDetails selectSysClientDetailsById(String clientId)
29
+    {
30
+        return sysClientDetailsMapper.selectSysClientDetailsById(clientId);
31
+    }
32
+
33
+    /**
34
+     * 查询终端配置列表
35
+     * 
36
+     * @param sysClientDetails 终端配置
37
+     * @return 终端配置
38
+     */
39
+    @Override
40
+    public List<SysClientDetails> selectSysClientDetailsList(SysClientDetails sysClientDetails)
41
+    {
42
+        return sysClientDetailsMapper.selectSysClientDetailsList(sysClientDetails);
43
+    }
44
+
45
+    /**
46
+     * 新增终端配置
47
+     * 
48
+     * @param sysClientDetails 终端配置
49
+     * @return 结果
50
+     */
51
+    @Override
52
+    public int insertSysClientDetails(SysClientDetails sysClientDetails)
53
+    {
54
+        return sysClientDetailsMapper.insertSysClientDetails(sysClientDetails);
55
+    }
56
+
57
+    /**
58
+     * 修改终端配置
59
+     * 
60
+     * @param sysClientDetails 终端配置
61
+     * @return 结果
62
+     */
63
+    @Override
64
+    public int updateSysClientDetails(SysClientDetails sysClientDetails)
65
+    {
66
+        return sysClientDetailsMapper.updateSysClientDetails(sysClientDetails);
67
+    }
68
+
69
+    /**
70
+     * 批量删除终端配置
71
+     * 
72
+     * @param clientIds 需要删除的终端配置ID
73
+     * @return 结果
74
+     */
75
+    @Override
76
+    public int deleteSysClientDetailsByIds(String[] clientIds)
77
+    {
78
+        return sysClientDetailsMapper.deleteSysClientDetailsByIds(clientIds);
79
+    }
80
+
81
+    /**
82
+     * 删除终端配置信息
83
+     * 
84
+     * @param clientId 终端配置ID
85
+     * @return 结果
86
+     */
87
+    @Override
88
+    public int deleteSysClientDetailsById(String clientId)
89
+    {
90
+        return sysClientDetailsMapper.deleteSysClientDetailsById(clientId);
91
+    }
92
+}

+ 2 - 2
ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysLogininforServiceImpl.java

@@ -25,9 +25,9 @@ public class SysLogininforServiceImpl implements ISysLogininforService
25 25
      * @param logininfor 访问日志对象
26 26
      */
27 27
     @Override
28
-    public void insertLogininfor(SysLogininfor logininfor)
28
+    public int insertLogininfor(SysLogininfor logininfor)
29 29
     {
30
-        logininforMapper.insertLogininfor(logininfor);
30
+        return logininforMapper.insertLogininfor(logininfor);
31 31
     }
32 32
 
33 33
     /**

+ 95 - 0
ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysClientDetailsMapper.xml

@@ -0,0 +1,95 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper
3
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5
+<mapper namespace="com.ruoyi.system.mapper.SysClientDetailsMapper">
6
+    
7
+    <resultMap type="SysClientDetails" id="SysClientDetailsResult">
8
+        <result property="clientId"               column="client_id"                />
9
+        <result property="resourceIds"            column="resource_ids"             />
10
+        <result property="clientSecret"           column="client_secret"            />
11
+        <result property="scope"                  column="scope"                    />
12
+        <result property="authorizedGrantTypes"   column="authorized_grant_types"   />
13
+        <result property="webServerRedirectUri"   column="web_server_redirect_uri"  />
14
+        <result property="authorities"            column="authorities"              />
15
+        <result property="accessTokenValidity"    column="access_token_validity"    />
16
+        <result property="refreshTokenValidity"   column="refresh_token_validity"   />
17
+        <result property="additionalInformation"  column="additional_information"   />
18
+        <result property="autoapprove"            column="autoapprove"              />
19
+    </resultMap>
20
+
21
+    <sql id="selectSysClientDetailsVo">
22
+        select client_id, resource_ids, client_secret, scope, authorized_grant_types, web_server_redirect_uri, authorities, access_token_validity, refresh_token_validity, additional_information, autoapprove from sys_oauth_client_details
23
+    </sql>
24
+
25
+    <select id="selectSysClientDetailsList" parameterType="SysClientDetails" resultMap="SysClientDetailsResult">
26
+        <include refid="selectSysClientDetailsVo"/>
27
+        <where>  
28
+            <if test="clientId != null  and clientId != ''"> and client_id = #{clientId}</if>
29
+        </where>
30
+    </select>
31
+    
32
+    <select id="selectSysClientDetailsById" parameterType="String" resultMap="SysClientDetailsResult">
33
+        <include refid="selectSysClientDetailsVo"/>
34
+        where client_id = #{clientId}
35
+    </select>
36
+        
37
+    <insert id="insertSysClientDetails" parameterType="SysClientDetails">
38
+        insert into sys_oauth_client_details
39
+        <trim prefix="(" suffix=")" suffixOverrides=",">
40
+            <if test="clientId != null">client_id,</if>
41
+            <if test="resourceIds != null">resource_ids,</if>
42
+            <if test="clientSecret != null">client_secret,</if>
43
+            <if test="scope != null">scope,</if>
44
+            <if test="authorizedGrantTypes != null">authorized_grant_types,</if>
45
+            <if test="webServerRedirectUri != null">web_server_redirect_uri,</if>
46
+            <if test="authorities != null">authorities,</if>
47
+            <if test="accessTokenValidity != null">access_token_validity,</if>
48
+            <if test="refreshTokenValidity != null">refresh_token_validity,</if>
49
+            <if test="additionalInformation != null">additional_information,</if>
50
+            <if test="autoapprove != null">autoapprove,</if>
51
+         </trim>
52
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
53
+            <if test="clientId != null">#{clientId},</if>
54
+            <if test="resourceIds != null">#{resourceIds},</if>
55
+            <if test="clientSecret != null">#{clientSecret},</if>
56
+            <if test="scope != null">#{scope},</if>
57
+            <if test="authorizedGrantTypes != null">#{authorizedGrantTypes},</if>
58
+            <if test="webServerRedirectUri != null">#{webServerRedirectUri},</if>
59
+            <if test="authorities != null">#{authorities},</if>
60
+            <if test="accessTokenValidity != null">#{accessTokenValidity},</if>
61
+            <if test="refreshTokenValidity != null">#{refreshTokenValidity},</if>
62
+            <if test="additionalInformation != null">#{additionalInformation},</if>
63
+            <if test="autoapprove != null ">#{autoapprove},</if>
64
+         </trim>
65
+    </insert>
66
+
67
+    <update id="updateSysClientDetails" parameterType="SysClientDetails">
68
+        update sys_oauth_client_details
69
+        <trim prefix="SET" suffixOverrides=",">
70
+            <if test="resourceIds != null">resource_ids = #{resourceIds},</if>
71
+            <if test="clientSecret != null">client_secret = #{clientSecret},</if>
72
+            <if test="scope != null">scope = #{scope},</if>
73
+            <if test="authorizedGrantTypes != null">authorized_grant_types = #{authorizedGrantTypes},</if>
74
+            <if test="webServerRedirectUri != null">web_server_redirect_uri = #{webServerRedirectUri},</if>
75
+            <if test="authorities != null">authorities = #{authorities},</if>
76
+            <if test="accessTokenValidity != null">access_token_validity = #{accessTokenValidity},</if>
77
+            <if test="refreshTokenValidity != null">refresh_token_validity = #{refreshTokenValidity},</if>
78
+            <if test="additionalInformation != null">additional_information = #{additionalInformation},</if>
79
+            <if test="autoapprove != null">autoapprove = #{autoapprove},</if>
80
+        </trim>
81
+        where client_id = #{clientId}
82
+    </update>
83
+
84
+    <delete id="deleteSysClientDetailsById" parameterType="String">
85
+        delete from sys_oauth_client_details where client_id = #{clientId}
86
+    </delete>
87
+
88
+    <delete id="deleteSysClientDetailsByIds" parameterType="String">
89
+        delete from sys_oauth_client_details where client_id in 
90
+        <foreach item="clientId" collection="array" open="(" separator="," close=")">
91
+            #{clientId}
92
+        </foreach>
93
+    </delete>
94
+    
95
+</mapper>

+ 6 - 9
ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysLogininforMapper.xml

@@ -9,20 +9,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
9 9
 		<result property="userName"      column="user_name"         />
10 10
 		<result property="status"        column="status"            />
11 11
 		<result property="ipaddr"        column="ipaddr"            />
12
-		<result property="loginLocation" column="login_location"    />
13
-		<result property="browser"       column="browser"           />
14
-		<result property="os"            column="os"                />
15 12
 		<result property="msg"           column="msg"               />
16
-		<result property="loginTime"     column="login_time"        />
13
+		<result property="accessTime"    column="access_time"       />
17 14
 	</resultMap>
18 15
 
19 16
 	<insert id="insertLogininfor" parameterType="SysLogininfor">
20
-		insert into sys_logininfor (user_name, status, ipaddr, login_location, browser, os, msg, login_time)
21
-		values (#{userName}, #{status}, #{ipaddr}, #{loginLocation}, #{browser}, #{os}, #{msg}, sysdate())
17
+		insert into sys_logininfor (user_name, status, ipaddr, msg, access_time)
18
+		values (#{userName}, #{status}, #{ipaddr}, #{msg}, sysdate())
22 19
 	</insert>
23 20
 	
24 21
 	<select id="selectLogininforList" parameterType="SysLogininfor" resultMap="SysLogininforResult">
25
-		select info_id, user_name, ipaddr, login_location, browser, os, status, msg, login_time from sys_logininfor
22
+		select info_id, user_name, ipaddr, status, msg, access_time from sys_logininfor
26 23
 		<where>
27 24
 			<if test="ipaddr != null and ipaddr != ''">
28 25
 				AND ipaddr like concat('%', #{ipaddr}, '%')
@@ -34,10 +31,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
34 31
 				AND user_name like concat('%', #{userName}, '%')
35 32
 			</if>
36 33
 			<if test="beginTime != null and beginTime != ''"><!-- 开始时间检索 -->
37
-				and date_format(login_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d')
34
+				and date_format(access_time,'%y%m%d') &gt;= date_format(#{beginTime},'%y%m%d')
38 35
 			</if>
39 36
 			<if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
40
-				and date_format(login_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
37
+				and date_format(access_time,'%y%m%d') &lt;= date_format(#{endTime},'%y%m%d')
41 38
 			</if>
42 39
 		</where>
43 40
 		order by info_id desc

+ 3 - 4
ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysOperLogMapper.xml

@@ -15,7 +15,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
15 15
 		<result property="deptName"       column="dept_name"      />
16 16
 		<result property="operUrl"        column="oper_url"       />
17 17
 		<result property="operIp"         column="oper_ip"        />
18
-		<result property="operLocation"   column="oper_location"  />
19 18
 		<result property="operParam"      column="oper_param"     />
20 19
 		<result property="jsonResult"     column="json_result"    />
21 20
 		<result property="status"         column="status"         />
@@ -24,13 +23,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
24 23
 	</resultMap>
25 24
 
26 25
 	<sql id="selectOperLogVo">
27
-        select oper_id, title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time
26
+        select oper_id, title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_param, json_result, status, error_msg, oper_time
28 27
         from sys_oper_log
29 28
     </sql>
30 29
     
31 30
 	<insert id="insertOperlog" parameterType="SysOperLog">
32
-		insert into sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, oper_time)
33
-        values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, sysdate())
31
+		insert into sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_param, json_result, status, error_msg, oper_time)
32
+        values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, sysdate())
34 33
 	</insert>
35 34
 	
36 35
 	<select id="selectOperLogList" parameterType="SysOperLog" resultMap="SysOperLogResult">

+ 44 - 0
ruoyi-ui/src/api/system/client.js

@@ -0,0 +1,44 @@
1
+import request from '@/utils/request'
2
+
3
+// 查询终端配置列表
4
+export function listClient(query) {
5
+  return request({
6
+    url: '/system/client/list',
7
+    method: 'get',
8
+    params: query
9
+  })
10
+}
11
+
12
+// 查询终端配置详细
13
+export function getClient(clientId) {
14
+  return request({
15
+    url: '/system/client/' + clientId,
16
+    method: 'get'
17
+  })
18
+}
19
+
20
+// 新增终端配置
21
+export function addClient(data) {
22
+  return request({
23
+    url: '/system/client',
24
+    method: 'post',
25
+    data: data
26
+  })
27
+}
28
+
29
+// 修改终端配置
30
+export function updateClient(data) {
31
+  return request({
32
+    url: '/system/client',
33
+    method: 'put',
34
+    data: data
35
+  })
36
+}
37
+
38
+// 删除终端配置
39
+export function delClient(clientId) {
40
+  return request({
41
+    url: '/system/client/' + clientId,
42
+    method: 'delete'
43
+  })
44
+}

Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 0
ruoyi-ui/src/assets/icons/svg/client.svg


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 0
ruoyi-ui/src/assets/icons/svg/nacos.svg


Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 0
ruoyi-ui/src/assets/icons/svg/sentinel.svg


+ 271 - 0
ruoyi-ui/src/views/system/client/index.vue

@@ -0,0 +1,271 @@
1
+<template>
2
+  <div class="app-container">
3
+    <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
4
+      <el-form-item label="终端编号" prop="clientId">
5
+        <el-input
6
+          v-model="queryParams.clientId"
7
+          placeholder="终端编号"
8
+          clearable
9
+          size="small"
10
+          @keyup.enter.native="handleQuery"
11
+        />
12
+      </el-form-item>
13
+      <el-form-item>
14
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
15
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
16
+      </el-form-item>
17
+    </el-form>
18
+
19
+    <el-row :gutter="10" class="mb8">
20
+      <el-col :span="1.5">
21
+        <el-button
22
+          type="primary"
23
+          icon="el-icon-plus"
24
+          size="mini"
25
+          @click="handleAdd"
26
+          v-hasPermi="['system:client:add']"
27
+        >新增</el-button>
28
+      </el-col>
29
+      <el-col :span="1.5">
30
+        <el-button
31
+          type="success"
32
+          icon="el-icon-edit"
33
+          size="mini"
34
+          :disabled="single"
35
+          @click="handleUpdate"
36
+          v-hasPermi="['system:client:edit']"
37
+        >修改</el-button>
38
+      </el-col>
39
+      <el-col :span="1.5">
40
+        <el-button
41
+          type="danger"
42
+          icon="el-icon-delete"
43
+          size="mini"
44
+          :disabled="multiple"
45
+          @click="handleDelete"
46
+          v-hasPermi="['system:client:remove']"
47
+        >删除</el-button>
48
+      </el-col>
49
+    </el-row>
50
+
51
+    <el-table v-loading="loading" :data="clientList" @selection-change="handleSelectionChange">
52
+      <el-table-column type="selection" width="55" align="center" />
53
+      <el-table-column label="编号" align="center" prop="clientId" />
54
+      <el-table-column label="安全码" align="center" prop="clientSecret" :show-overflow-tooltip="true" />
55
+      <el-table-column label="授权范围" align="center" prop="scope" />
56
+      <el-table-column label="授权类型" align="center" prop="authorizedGrantTypes" :show-overflow-tooltip="true" />
57
+      <el-table-column label="令牌时效" align="center" prop="accessTokenValidity" />
58
+      <el-table-column label="刷新时效" align="center" prop="refreshTokenValidity" />
59
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
60
+        <template slot-scope="scope">
61
+          <el-button
62
+            size="mini"
63
+            type="text"
64
+            icon="el-icon-edit"
65
+            @click="handleUpdate(scope.row)"
66
+            v-hasPermi="['system:client:edit']"
67
+          >修改</el-button>
68
+          <el-button
69
+            size="mini"
70
+            type="text"
71
+            icon="el-icon-delete"
72
+            @click="handleDelete(scope.row)"
73
+            v-hasPermi="['system:client:remove']"
74
+          >删除</el-button>
75
+        </template>
76
+      </el-table-column>
77
+    </el-table>
78
+
79
+    <pagination
80
+      v-show="total>0"
81
+      :total="total"
82
+      :page.sync="queryParams.pageNum"
83
+      :limit.sync="queryParams.pageSize"
84
+      @pagination="getList"
85
+    />
86
+
87
+    <!-- 添加或修改终端对话框 -->
88
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
89
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
90
+        <el-form-item label="编号" prop="clientId">
91
+          <el-input v-model="form.clientId" placeholder="请输入编号" :disabled="!isAdd" />
92
+        </el-form-item>
93
+        <el-form-item label="安全码" prop="clientSecret">
94
+          <el-input v-model="form.clientSecret" placeholder="请输入安全码" />
95
+        </el-form-item>
96
+        <el-form-item label="授权范围" prop="scope">
97
+          <el-input v-model="form.scope" placeholder="请输入授权范围" />
98
+        </el-form-item>
99
+        <el-form-item label="授权类型" prop="authorizedGrantTypes">
100
+          <el-input v-model="form.authorizedGrantTypes" placeholder="请输入授权类型" />
101
+        </el-form-item>
102
+        <el-form-item label="令牌时效" prop="accessTokenValidity">
103
+          <el-input-number v-model="form.accessTokenValidity" controls-position="right" :min="0" />
104
+        </el-form-item>
105
+        <el-form-item label="刷新时效" prop="refreshTokenValidity">
106
+          <el-input-number v-model="form.refreshTokenValidity" controls-position="right" :min="0" />
107
+        </el-form-item>
108
+      </el-form>
109
+      <div slot="footer" class="dialog-footer">
110
+        <el-button type="primary" @click="submitForm">确 定</el-button>
111
+        <el-button @click="cancel">取 消</el-button>
112
+      </div>
113
+    </el-dialog>
114
+  </div>
115
+</template>
116
+
117
+<script>
118
+import { listClient, getClient, delClient, addClient, updateClient } from "@/api/system/client";
119
+
120
+export default {
121
+  name: "Client",
122
+  data() {
123
+    return {
124
+      // 遮罩层
125
+      loading: true,
126
+      // 选中数组
127
+      ids: [],
128
+      // 非单个禁用
129
+      single: true,
130
+      // 非多个禁用
131
+      multiple: true,
132
+      // 总条数
133
+      total: 0,
134
+      // 终端表格数据
135
+      clientList: [],
136
+      // 弹出层标题
137
+      title: "",
138
+      // 是否显示弹出层
139
+      open: false,
140
+      // 查询参数
141
+      queryParams: {
142
+        pageNum: 1,
143
+        pageSize: 10,
144
+        clientId: undefined
145
+      },
146
+      // 是否新增
147
+      isAdd: false,
148
+      // 表单参数
149
+      form: {},
150
+      // 表单校验
151
+      rules: {
152
+        clientId: [
153
+          { required: true, message: "编号不能为空", trigger: "blur" }
154
+        ],
155
+        clientSecret: [
156
+          { required: true, message: "安全码不能为空", trigger: "blur" }
157
+        ],
158
+        scope: [
159
+          { required: true, message: "授权范围不能为空", trigger: "blur" }
160
+        ],
161
+        authorizedGrantTypes: [
162
+          { required: true, message: "授权类型不能为空", trigger: "blur" }
163
+        ]
164
+      }
165
+    };
166
+  },
167
+  created() {
168
+    this.getList();
169
+  },
170
+  methods: {
171
+    /** 查询终端列表 */
172
+    getList() {
173
+      this.loading = true;
174
+      listClient(this.queryParams).then(response => {
175
+        this.clientList = response.rows;
176
+        this.total = response.total;
177
+        this.loading = false;
178
+      });
179
+    },
180
+    // 取消按钮
181
+    cancel() {
182
+      this.open = false;
183
+      this.reset();
184
+    },
185
+    // 表单重置
186
+    reset() {
187
+      this.form = {
188
+        clientId: undefined,
189
+        clientSecret: undefined,
190
+        scope: "server",
191
+        authorizedGrantTypes: "password,refresh_token",
192
+        accessTokenValidity: 3600,
193
+        refreshTokenValidity: 7200
194
+      };
195
+      this.resetForm("form");
196
+    },
197
+    /** 搜索按钮操作 */
198
+    handleQuery() {
199
+      this.queryParams.pageNum = 1;
200
+      this.getList();
201
+    },
202
+    /** 重置按钮操作 */
203
+    resetQuery() {
204
+      this.resetForm("queryForm");
205
+      this.handleQuery();
206
+    },
207
+    // 多选框选中数据
208
+    handleSelectionChange(selection) {
209
+      this.ids = selection.map(item => item.clientId);
210
+      this.single = selection.length != 1;
211
+      this.multiple = !selection.length;
212
+    },
213
+    /** 新增按钮操作 */
214
+    handleAdd() {
215
+      this.reset();
216
+      this.open = true;
217
+      this.isAdd = true;
218
+      this.title = "添加终端";
219
+    },
220
+    /** 修改按钮操作 */
221
+    handleUpdate(row) {
222
+      this.reset();
223
+      this.isAdd = false;
224
+      const clientId = row.clientId || this.ids;
225
+      getClient(clientId).then(response => {
226
+        this.form = response.data;
227
+        this.open = true;
228
+        this.title = "修改终端";
229
+      });
230
+    },
231
+    /** 提交按钮 */
232
+    submitForm: function() {
233
+      this.$refs["form"].validate(valid => {
234
+        if (valid) {
235
+          if (!this.isAdd && this.form.clientId != undefined) {
236
+            updateClient(this.form).then(response => {
237
+              if (response.code === 200) {
238
+                this.msgSuccess("修改成功");
239
+                this.open = false;
240
+                this.getList();
241
+              }
242
+            });
243
+          } else {
244
+            addClient(this.form).then(response => {
245
+              if (response.code === 200) {
246
+                this.msgSuccess("新增成功");
247
+                this.open = false;
248
+                this.getList();
249
+              }
250
+            });
251
+          }
252
+        }
253
+      });
254
+    },
255
+    /** 删除按钮操作 */
256
+    handleDelete(row) {
257
+      const clientIds = row.clientId || this.ids;
258
+      this.$confirm('是否确认删除终端编号为"' + clientIds + '"的数据项?', "警告", {
259
+          confirmButtonText: "确定",
260
+          cancelButtonText: "取消",
261
+          type: "warning"
262
+        }).then(function() {
263
+          return delClient(clientIds);
264
+        }).then(() => {
265
+          this.getList();
266
+          this.msgSuccess("删除成功");
267
+        }).catch(function() {});
268
+    }
269
+  }
270
+};
271
+</script>

+ 5 - 8
ruoyi-ui/src/views/system/logininfor/index.vue

@@ -90,15 +90,12 @@
90 90
       <el-table-column type="selection" width="55" align="center" />
91 91
       <el-table-column label="访问编号" align="center" prop="infoId" />
92 92
       <el-table-column label="用户名称" align="center" prop="userName" />
93
-      <el-table-column label="登录地址" align="center" prop="ipaddr" width="130" :show-overflow-tooltip="true" />
94
-      <el-table-column label="登录地点" align="center" prop="loginLocation" :show-overflow-tooltip="true" />
95
-      <el-table-column label="浏览器" align="center" prop="browser" />
96
-      <el-table-column label="操作系统" align="center" prop="os" />
97
-      <el-table-column label="登录状态" align="center" prop="status" :formatter="statusFormat" />
98
-      <el-table-column label="操作信息" align="center" prop="msg" />
99
-      <el-table-column label="登录日期" align="center" prop="loginTime" width="180">
93
+      <el-table-column label="地址" align="center" prop="ipaddr" width="130" :show-overflow-tooltip="true" />
94
+      <el-table-column label="状态" align="center" prop="status" :formatter="statusFormat" />
95
+      <el-table-column label="描述" align="center" prop="msg" />
96
+      <el-table-column label="访问时间" align="center" prop="accessTime" width="180">
100 97
         <template slot-scope="scope">
101
-          <span>{{ parseTime(scope.row.loginTime) }}</span>
98
+          <span>{{ parseTime(scope.row.accessTime) }}</span>
102 99
         </template>
103 100
       </el-table-column>
104 101
     </el-table>

+ 1 - 2
ruoyi-ui/src/views/system/operlog/index.vue

@@ -110,7 +110,6 @@
110 110
       <el-table-column label="请求方式" align="center" prop="requestMethod" />
111 111
       <el-table-column label="操作人员" align="center" prop="operName" />
112 112
       <el-table-column label="主机" align="center" prop="operIp" width="130" :show-overflow-tooltip="true" />
113
-      <el-table-column label="操作地点" align="center" prop="operLocation" :show-overflow-tooltip="true" />
114 113
       <el-table-column label="操作状态" align="center" prop="status" :formatter="statusFormat" />
115 114
       <el-table-column label="操作日期" align="center" prop="operTime" width="180">
116 115
         <template slot-scope="scope">
@@ -146,7 +145,7 @@
146 145
             <el-form-item label="操作模块:">{{ form.title }} / {{ typeFormat(form) }}</el-form-item>
147 146
             <el-form-item
148 147
               label="登录信息:"
149
-            >{{ form.operName }} / {{ form.operIp }} / {{ form.operLocation }}</el-form-item>
148
+            >{{ form.operName }} / {{ form.operIp }}</el-form-item>
150 149
           </el-col>
151 150
           <el-col :span="12">
152 151
             <el-form-item label="请求地址:">{{ form.operUrl }}</el-form-item>

+ 1 - 1
ruoyi-visual/pom.xml

@@ -4,7 +4,7 @@
4 4
     <parent>
5 5
         <groupId>com.ruoyi</groupId>
6 6
         <artifactId>ruoyi</artifactId>
7
-        <version>1.0.0</version>
7
+        <version>2.0.0</version>
8 8
     </parent>
9 9
     <modelVersion>4.0.0</modelVersion>
10 10
 

+ 3 - 3
ruoyi-visual/ruoyi-monitor/pom.xml

@@ -35,10 +35,10 @@
35 35
             <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
36 36
         </dependency>
37 37
 
38
-        <!-- SpringCloud Netflix Hystrix -->
38
+        <!-- SpringCloud Ailibaba Sentinel -->
39 39
         <dependency>
40
-            <groupId>org.springframework.cloud</groupId>
41
-            <artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
40
+            <groupId>com.alibaba.cloud</groupId>
41
+            <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
42 42
         </dependency>
43 43
 		
44 44
         <!-- SpringBoot Web -->

+ 62 - 57
sql/ry_20200520.sql

@@ -158,25 +158,26 @@ insert into sys_menu values('2', '系统监控', '0', '2', 'monitor',          n
158 158
 insert into sys_menu values('3', '系统工具', '0', '3', 'tool',             null,   1, 'M', '0', '0', '', 'tool',     'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '系统工具目录');
159 159
 insert into sys_menu values('4', '若依官网', '0', '4', 'http://ruoyi.vip', null ,  0, 'M', '0', '0', '', 'guide',    'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '若依官网地址');
160 160
 -- 二级菜单
161
-insert into sys_menu values('100',  '用户管理', '1',   '1', 'user',       'system/user/index',           1, 'C', '0', '0', 'system:user:list',        'user',          'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '用户管理菜单');
162
-insert into sys_menu values('101',  '角色管理', '1',   '2', 'role',       'system/role/index',           1, 'C', '0', '0', 'system:role:list',        'peoples',       'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '角色管理菜单');
163
-insert into sys_menu values('102',  '菜单管理', '1',   '3', 'menu',       'system/menu/index',           1, 'C', '0', '0', 'system:menu:list',        'tree-table',    'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '菜单管理菜单');
164
-insert into sys_menu values('103',  '部门管理', '1',   '4', 'dept',       'system/dept/index',           1, 'C', '0', '0', 'system:dept:list',        'tree',          'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '部门管理菜单');
165
-insert into sys_menu values('104',  '岗位管理', '1',   '5', 'post',       'system/post/index',           1, 'C', '0', '0', 'system:post:list',        'post',          'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '岗位管理菜单');
166
-insert into sys_menu values('105',  '字典管理', '1',   '6', 'dict',       'system/dict/index',           1, 'C', '0', '0', 'system:dict:list',        'dict',          'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '字典管理菜单');
167
-insert into sys_menu values('106',  '参数设置', '1',   '7', 'config',     'system/config/index',         1, 'C', '0', '0', 'system:config:list',      'edit',          'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '参数设置菜单');
168
-insert into sys_menu values('107',  '通知公告', '1',   '8', 'notice',     'system/notice/index',         1, 'C', '0', '0', 'system:notice:list',      'message',       'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '通知公告菜单');
169
-insert into sys_menu values('108',  '日志管理', '1',   '9', 'log',        'system/log/index',            1, 'M', '0', '0', '',                        'log',           'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '日志管理菜单');
170
-insert into sys_menu values('109',  '在线用户', '2',   '1', 'online',     'monitor/online/index',        1, 'C', '0', '0', 'monitor:online:list',     'online',        'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '在线用户菜单');
171
-insert into sys_menu values('110',  '定时任务', '2',   '2', 'job',        'monitor/job/index',           1, 'C', '0', '0', 'monitor:job:list',        'job',           'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '定时任务菜单');
172
-insert into sys_menu values('111',  '数据监控', '2',   '3', 'druid',      'monitor/druid/index',         1, 'C', '0', '0', 'monitor:druid:list',      'druid',         'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '数据监控菜单');
173
-insert into sys_menu values('112',  '服务监控', '2',   '4', 'http://localhost:9100/login',           '', 1, 'C', '0', '0', 'monitor:server:list',     'server',        'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '服务监控菜单');
174
-insert into sys_menu values('113',  '表单构建', '3',   '1', 'build',      'tool/build/index',            1 ,'C', '0', '0', 'tool:build:list',         'build',         'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '表单构建菜单');
175
-insert into sys_menu values('114',  '代码生成', '3',   '2', 'gen',        'tool/gen/index',              1, 'C', '0', '0', 'tool:gen:list',           'code',          'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '代码生成菜单');
176
-insert into sys_menu values('115',  '系统接口', '3',   '3', 'http://localhost:8080/swagger-ui.html', '', 1, 'C', '0', '0', 'tool:swagger:list',       'swagger',       'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '系统接口菜单');
161
+insert into sys_menu values('100',  '用户管理',       '1',   '1',  'user',                                'system/user/index',       1, 'C', '0', '0', 'system:user:list',        'user',          'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '用户管理菜单');
162
+insert into sys_menu values('101',  '角色管理',       '1',   '2',  'role',                                'system/role/index',       1, 'C', '0', '0', 'system:role:list',        'peoples',       'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '角色管理菜单');
163
+insert into sys_menu values('102',  '菜单管理',       '1',   '3',  'menu',                                'system/menu/index',       1, 'C', '0', '0', 'system:menu:list',        'tree-table',    'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '菜单管理菜单');
164
+insert into sys_menu values('103',  '部门管理',       '1',   '4',  'dept',                                'system/dept/index',       1, 'C', '0', '0', 'system:dept:list',        'tree',          'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '部门管理菜单');
165
+insert into sys_menu values('104',  '岗位管理',       '1',   '5',  'post',                                'system/post/index',       1, 'C', '0', '0', 'system:post:list',        'post',          'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '岗位管理菜单');
166
+insert into sys_menu values('105',  '字典管理',       '1',   '6',  'dict',                                'system/dict/index',       1, 'C', '0', '0', 'system:dict:list',        'dict',          'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '字典管理菜单');
167
+insert into sys_menu values('106',  '参数设置',       '1',   '7',  'config',                              'system/config/index',     1, 'C', '0', '0', 'system:config:list',      'edit',          'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '参数设置菜单');
168
+insert into sys_menu values('107',  '终端设置',       '1',   '8',  'client',                              'system/client/index',     1, 'C', '0', '0', 'system:client:list',      'client',        'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '终端设置菜单');
169
+insert into sys_menu values('108',  '通知公告',       '1',   '9',  'notice',                              'system/notice/index',     1, 'C', '0', '0', 'system:notice:list',      'message',       'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '通知公告菜单');
170
+insert into sys_menu values('109',  '日志管理',       '1',   '10', 'log',                                 'system/log/index',        1, 'M', '0', '0', '',                        'log',           'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '日志管理菜单');
171
+insert into sys_menu values('110',  '定时任务',       '2',   '1',  'job',                                 'monitor/job/index',       1, 'C', '0', '0', 'monitor:job:list',        'job',           'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '定时任务菜单');
172
+insert into sys_menu values('111',  'Sentinel控制台', '2',   '2',  'http://localhost:8718',                '',                       1, 'C', '0', '0', 'monitor:sentinel:list',   'sentinel',      'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '流量控制菜单');
173
+insert into sys_menu values('112',  'Nacos控制台',    '2',   '3',  'http://localhost:8848/nacos',          '',                       1, 'C', '0', '0', 'monitor:nacos:list',      'nacos',         'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '服务治理菜单');
174
+insert into sys_menu values('113',  'Admin控制台',    '2',   '4',  'http://localhost:9100/login',          '',                       1, 'C', '0', '0', 'monitor:server:list',     'server',        'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '服务监控菜单');
175
+insert into sys_menu values('114',  '表单构建',       '3',   '1',  'build',                                'tool/build/index',       1 ,'C', '0', '0', 'tool:build:list',         'build',         'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '表单构建菜单');
176
+insert into sys_menu values('115',  '代码生成',       '3',   '2',  'gen',                                  'tool/gen/index',         1, 'C', '0', '0', 'tool:gen:list',           'code',          'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '代码生成菜单');
177
+insert into sys_menu values('116',  '系统接口',       '3',   '3',  'http://localhost:8080/swagger-ui.html', '',                      1, 'C', '0', '0', 'tool:swagger:list',       'swagger',       'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '系统接口菜单');
177 178
 -- 三级菜单
178
-insert into sys_menu values('500',  '操作日志', '108', '1', 'operlog',    'system/operlog/index',     1, 'C', '0', '0', 'system:operlog:list',     'form',          'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '操作日志菜单');
179
-insert into sys_menu values('501',  '登录日志', '108', '2', 'logininfor', 'system/logininfor/index',  1, 'C', '0', '0', 'system:logininfor:list',  'logininfor',    'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '登录日志菜单');
179
+insert into sys_menu values('500',  '操作日志', '109', '1', 'operlog',    'system/operlog/index',     1, 'C', '0', '0', 'system:operlog:list',     'form',          'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '操作日志菜单');
180
+insert into sys_menu values('501',  '登录日志', '109', '2', 'logininfor', 'system/logininfor/index',  1, 'C', '0', '0', 'system:logininfor:list',  'logininfor',    'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '登录日志菜单');
180 181
 -- 用户管理按钮
181 182
 insert into sys_menu values('1001', '用户查询', '100', '1',  '', '', 1, 'F', '0', '0', 'system:user:query',          '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
182 183
 insert into sys_menu values('1002', '用户新增', '100', '2',  '', '', 1, 'F', '0', '0', 'system:user:add',            '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
@@ -219,37 +220,39 @@ insert into sys_menu values('1032', '参数新增', '106', '2', '#', '', 1, 'F',
219 220
 insert into sys_menu values('1033', '参数修改', '106', '3', '#', '', 1, 'F', '0', '0', 'system:config:edit',         '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
220 221
 insert into sys_menu values('1034', '参数删除', '106', '4', '#', '', 1, 'F', '0', '0', 'system:config:remove',       '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
221 222
 insert into sys_menu values('1035', '参数导出', '106', '5', '#', '', 1, 'F', '0', '0', 'system:config:export',       '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
223
+-- 终端设置按钮
224
+insert into sys_menu values('1036', '终端查询', '107', '1', '#', '', 1, 'F', '0', '0', 'system:client:query',        '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
225
+insert into sys_menu values('1037', '终端新增', '107', '2', '#', '', 1, 'F', '0', '0', 'system:client:add',          '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
226
+insert into sys_menu values('1038', '终端修改', '107', '3', '#', '', 1, 'F', '0', '0', 'system:client:edit',         '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
227
+insert into sys_menu values('1039', '终端删除', '107', '4', '#', '', 1, 'F', '0', '0', 'system:client:remove',       '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
228
+insert into sys_menu values('1040', '终端导出', '107', '5', '#', '', 1, 'F', '0', '0', 'system:client:export',       '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
222 229
 -- 通知公告按钮
223
-insert into sys_menu values('1036', '公告查询', '107', '1', '#', '', 1, 'F', '0', '0', 'system:notice:query',        '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
224
-insert into sys_menu values('1037', '公告新增', '107', '2', '#', '', 1, 'F', '0', '0', 'system:notice:add',          '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
225
-insert into sys_menu values('1038', '公告修改', '107', '3', '#', '', 1, 'F', '0', '0', 'system:notice:edit',         '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
226
-insert into sys_menu values('1039', '公告删除', '107', '4', '#', '', 1, 'F', '0', '0', 'system:notice:remove',       '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
230
+insert into sys_menu values('1041', '公告查询', '108', '1', '#', '', 1, 'F', '0', '0', 'system:notice:query',        '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
231
+insert into sys_menu values('1042', '公告新增', '108', '2', '#', '', 1, 'F', '0', '0', 'system:notice:add',          '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
232
+insert into sys_menu values('1043', '公告修改', '108', '3', '#', '', 1, 'F', '0', '0', 'system:notice:edit',         '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
233
+insert into sys_menu values('1044', '公告删除', '108', '4', '#', '', 1, 'F', '0', '0', 'system:notice:remove',       '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
227 234
 -- 操作日志按钮
228
-insert into sys_menu values('1040', '操作查询', '500', '1', '#', '', 1, 'F', '0', '0', 'system:operlog:query',       '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
229
-insert into sys_menu values('1041', '操作删除', '500', '2', '#', '', 1, 'F', '0', '0', 'system:operlog:remove',      '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
230
-insert into sys_menu values('1042', '日志导出', '500', '4', '#', '', 1, 'F', '0', '0', 'system:operlog:export',      '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
235
+insert into sys_menu values('1045', '操作查询', '500', '1', '#', '', 1, 'F', '0', '0', 'system:operlog:query',       '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
236
+insert into sys_menu values('1046', '操作删除', '500', '2', '#', '', 1, 'F', '0', '0', 'system:operlog:remove',      '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
237
+insert into sys_menu values('1047', '日志导出', '500', '4', '#', '', 1, 'F', '0', '0', 'system:operlog:export',      '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
231 238
 -- 登录日志按钮
232
-insert into sys_menu values('1043', '登录查询', '501', '1', '#', '', 1, 'F', '0', '0', 'system:logininfor:query',    '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
233
-insert into sys_menu values('1044', '登录删除', '501', '2', '#', '', 1, 'F', '0', '0', 'system:logininfor:remove',   '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
234
-insert into sys_menu values('1045', '日志导出', '501', '3', '#', '', 1, 'F', '0', '0', 'system:logininfor:export',   '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
235
-insert into sys_menu values('1046', '在线查询', '109', '1', '#', '', 1, 'F', '0', '0', 'monitor:online:query',       '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
236
-insert into sys_menu values('1047', '批量强退', '109', '2', '#', '', 1, 'F', '0', '0', 'monitor:online:batchLogout', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
237
-insert into sys_menu values('1048', '单条强退', '109', '3', '#', '', 1, 'F', '0', '0', 'monitor:online:forceLogout', '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
239
+insert into sys_menu values('1048', '登录查询', '501', '1', '#', '', 1, 'F', '0', '0', 'system:logininfor:query',    '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
240
+insert into sys_menu values('1049', '登录删除', '501', '2', '#', '', 1, 'F', '0', '0', 'system:logininfor:remove',   '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
241
+insert into sys_menu values('1050', '日志导出', '501', '3', '#', '', 1, 'F', '0', '0', 'system:logininfor:export',   '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
238 242
 -- 定时任务按钮
239
-insert into sys_menu values('1049', '任务查询', '110', '1', '#', '', 1, 'F', '0', '0', 'monitor:job:query',          '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
240
-insert into sys_menu values('1050', '任务新增', '110', '2', '#', '', 1, 'F', '0', '0', 'monitor:job:add',            '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
241
-insert into sys_menu values('1051', '任务修改', '110', '3', '#', '', 1, 'F', '0', '0', 'monitor:job:edit',           '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
242
-insert into sys_menu values('1052', '任务删除', '110', '4', '#', '', 1, 'F', '0', '0', 'monitor:job:remove',         '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
243
-insert into sys_menu values('1053', '状态修改', '110', '5', '#', '', 1, 'F', '0', '0', 'monitor:job:changeStatus',   '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
244
-insert into sys_menu values('1054', '任务导出', '110', '7', '#', '', 1, 'F', '0', '0', 'monitor:job:export',         '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
243
+insert into sys_menu values('1051', '任务查询', '110', '1', '#', '', 1, 'F', '0', '0', 'monitor:job:query',          '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
244
+insert into sys_menu values('1052', '任务新增', '110', '2', '#', '', 1, 'F', '0', '0', 'monitor:job:add',            '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
245
+insert into sys_menu values('1053', '任务修改', '110', '3', '#', '', 1, 'F', '0', '0', 'monitor:job:edit',           '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
246
+insert into sys_menu values('1054', '任务删除', '110', '4', '#', '', 1, 'F', '0', '0', 'monitor:job:remove',         '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
247
+insert into sys_menu values('1055', '状态修改', '110', '5', '#', '', 1, 'F', '0', '0', 'monitor:job:changeStatus',   '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
248
+insert into sys_menu values('1056', '任务导出', '110', '7', '#', '', 1, 'F', '0', '0', 'monitor:job:export',         '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
245 249
 -- 代码生成按钮
246
-insert into sys_menu values('1055', '生成查询', '114', '1', '#', '', 1, 'F', '0', '0', 'tool:gen:query',             '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
247
-insert into sys_menu values('1056', '生成修改', '114', '2', '#', '', 1, 'F', '0', '0', 'tool:gen:edit',              '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
248
-insert into sys_menu values('1057', '生成删除', '114', '3', '#', '', 1, 'F', '0', '0', 'tool:gen:remove',            '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
249
-insert into sys_menu values('1058', '导入代码', '114', '2', '#', '', 1, 'F', '0', '0', 'tool:gen:import',            '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
250
-insert into sys_menu values('1059', '预览代码', '114', '4', '#', '', 1, 'F', '0', '0', 'tool:gen:preview',           '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
251
-insert into sys_menu values('1060', '生成代码', '114', '5', '#', '', 1, 'F', '0', '0', 'tool:gen:code',              '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
250
+insert into sys_menu values('1057', '生成查询', '115', '1', '#', '', 1, 'F', '0', '0', 'tool:gen:query',             '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
251
+insert into sys_menu values('1058', '生成修改', '115', '2', '#', '', 1, 'F', '0', '0', 'tool:gen:edit',              '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
252
+insert into sys_menu values('1059', '生成删除', '115', '3', '#', '', 1, 'F', '0', '0', 'tool:gen:remove',            '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
253
+insert into sys_menu values('1060', '导入代码', '115', '2', '#', '', 1, 'F', '0', '0', 'tool:gen:import',            '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
254
+insert into sys_menu values('1061', '预览代码', '115', '4', '#', '', 1, 'F', '0', '0', 'tool:gen:preview',           '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
255
+insert into sys_menu values('1062', '生成代码', '115', '5', '#', '', 1, 'F', '0', '0', 'tool:gen:code',              '#', 'admin', '2018-03-16 11-33-00', 'ry', '2018-03-16 11-33-00', '');
252 256
 
253 257
 
254 258
 -- ----------------------------
@@ -365,6 +368,8 @@ insert into sys_role_menu values ('2', '1057');
365 368
 insert into sys_role_menu values ('2', '1058');
366 369
 insert into sys_role_menu values ('2', '1059');
367 370
 insert into sys_role_menu values ('2', '1060');
371
+insert into sys_role_menu values ('2', '1061');
372
+insert into sys_role_menu values ('2', '1062');
368 373
 
369 374
 -- ----------------------------
370 375
 -- 8、角色和部门关联表  角色1-N部门
@@ -542,12 +547,9 @@ create table sys_logininfor (
542 547
   info_id        bigint(20)     not null auto_increment   comment '访问ID',
543 548
   user_name      varchar(50)    default ''                comment '用户账号',
544 549
   ipaddr         varchar(50)    default ''                comment '登录IP地址',
545
-  login_location varchar(255)   default ''                comment '登录地点',
546
-  browser        varchar(50)    default ''                comment '浏览器类型',
547
-  os             varchar(50)    default ''                comment '操作系统',
548 550
   status         char(1)        default '0'               comment '登录状态(0成功 1失败)',
549
-  msg            varchar(255)   default ''                comment '提示息',
550
-  login_time     datetime                                 comment '访问时间',
551
+  msg            varchar(255)   default ''                comment '提示信息',
552
+  access_time    datetime                                 comment '访问时间',
551 553
   primary key (info_id)
552 554
 ) engine=innodb auto_increment=100 comment = '系统访问记录';
553 555
 
@@ -677,26 +679,26 @@ create table gen_table_column (
677 679
 
678 680
 
679 681
 -- ----------------------------
682
+-- 20、终端配置表
680 683
 -- ----------------------------
681 684
 drop table if exists sys_oauth_client_details;
682 685
 create table sys_oauth_client_details (
683
-  client_id                  varchar(255)  not null          comment '客户端唯一标识',
686
+  client_id                  varchar(255)  not null          comment '终端编号',
684 687
   resource_ids               varchar(255)  default null      comment '资源ID标识',
685
-  client_secret              varchar(255)  not null          comment '客户端安全码',
686
-  scope                      varchar(255)  not null          comment '客户端授权范围',
687
-  authorized_grant_types     varchar(255)  not null          comment '客户端授权类型',
688
+  client_secret              varchar(255)  not null          comment '端安全码',
689
+  scope                      varchar(255)  not null          comment '端授权范围',
690
+  authorized_grant_types     varchar(255)  not null          comment '端授权类型',
688 691
   web_server_redirect_uri    varchar(255)  default null      comment '服务器回调地址',
689 692
   authorities                varchar(255)  default null      comment '访问资源所需权限',
690
-  access_token_validity      int(11)       default null      comment '设定客户端的access_token的有效时间值(秒)',
691
-  refresh_token_validity     int(11)       default null      comment '设定客户端的refresh_token的有效时间值(秒)',
692
-  additional_information     varchar(4096) default null      comment '预留字段',
693
-  autoapprove                tinyint(4)    default null      comment '是否登录时跳过授权(默认false)',
693
+  access_token_validity      int(11)       default null      comment '设定端的access_token的有效时间值(秒)',
694
+  refresh_token_validity     int(11)       default null      comment '设定端的refresh_token的有效时间值(秒)',
695
+  additional_information     varchar(4096) default null      comment '附加信息',
696
+  autoapprove                tinyint(4)    default null      comment '是否登录时跳过授权',
694 697
   primary key (client_id)
695
-) engine=innodb auto_increment=1 comment = '客户端配置表';
698
+) engine=innodb auto_increment=1 comment = '端配置表';
696 699
 
697 700
 -- ----------------------------
701
+-- 初始化-终端配置表数据
698 702
 -- ----------------------------
699 703
 insert into sys_oauth_client_details values ('web',    '', '$2a$10$y2hKeELx.z3Sbz.kjQ4wmuiIsv5ZSbUQ1ov4BwFH6ccirP8Knp1uq', 'server', 'password,refresh_token',                    '', NULL, 3600, 7200, NULL, NULL);
700 704
 insert into sys_oauth_client_details values ('ruoyi',  '', '$2a$10$y2hKeELx.z3Sbz.kjQ4wmuiIsv5ZSbUQ1ov4BwFH6ccirP8Knp1uq', 'server', 'password,client_credentials,refresh_token', '', NULL, 3600, 7200, NULL, NULL);

Dosya farkı çok büyük olduğundan ihmal edildi
+ 5 - 4
sql/ry_config_20200604.sql