From 4af1c07029a66573d95f5d5df76c81a68f3402b7 Mon Sep 17 00:00:00 2001 From: 18536819133 Date: Fri, 20 Oct 2023 16:25:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/SysRegisterController.java | 8 ++--- .../src/main/resources/application-druid.yml | 25 +++++++------- .../src/main/resources/application.yml | 6 ++-- .../web/service/SysRegisterService.java | 33 +++++++++---------- 4 files changed, 37 insertions(+), 35 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRegisterController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRegisterController.java index fe192492f..6da7b2b3e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRegisterController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRegisterController.java @@ -28,10 +28,10 @@ public class SysRegisterController extends BaseController @PostMapping("/register") public AjaxResult register(@RequestBody RegisterBody user) { - if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser")))) - { - return error("当前系统没有开启注册功能!"); - } +// if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser")))) +// { +// return error("当前系统没有开启注册功能!"); +// } String msg = registerService.register(user); return StringUtils.isEmpty(msg) ? success() : error(msg); } diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml index 31dfb10a3..9a5b90ed7 100644 --- a/ruoyi-admin/src/main/resources/application-druid.yml +++ b/ruoyi-admin/src/main/resources/application-druid.yml @@ -2,23 +2,24 @@ spring: datasource: type: com.alibaba.druid.pool.DruidDataSource -# driverClassName: com.mysql.cj.jdbc.Driver + # driverClassName: com.mysql.cj.jdbc.Driver driver-class-name: org.postgresql.Driver druid: master: - url: jdbc:postgresql://192.168.2.9:5432/yada?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=Asia/Shanghai - username: sjs - password: song5325 -# url: jdbc:mysql://192.168.2.9:3306/nuoyi?AllowPublicKeyRetrieval=True&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai -# username: saas -# password: XKrs123. + #url: jdbc:postgresql://47.243.79.66:5432/yada?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=Asia/Shanghai + #url: jdbc:postgresql://192.168.2.9:5432/yada?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=Asia/Shanghai + # username: postgres + # password: postgres + url: jdbc:postgresql://118.195.242.28:5432/yada?AllowPublicKeyRetrieval=True&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai + username: gty + password: 308525 # 从库数据源 slave: # 从数据源开关/默认关闭 enabled: false - url: - username: - password: + url: + username: + password: # 初始连接数 initialSize: 5 # 最小连接池数量 @@ -34,12 +35,12 @@ spring: # 配置一个连接在池中最大生存的时间,单位是毫秒 maxEvictableIdleTimeMillis: 900000 # 配置检测连接是否有效select * from pg_stat_activity -# validationQuery: SELECT 1 FROM DUAL + # validationQuery: SELECT 1 FROM DUAL validationQuery: SELECT version() testWhileIdle: true testOnBorrow: false testOnReturn: false - webStatFilter: + webStatFilter: enabled: true statViewServlet: enabled: true diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index 8a97bdf3e..5a4dec133 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -9,7 +9,7 @@ ruoyi: # 实例演示开关 demoEnabled: true # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath) - profile: D:/ruoyi/uploadPath + profile: /home/gty/ruoyi/uploadPath # 获取ip地址开关 addressEnabled: false # 验证码类型 math 数组计算 char 字符验证 @@ -19,6 +19,7 @@ ruoyi: server: # 服务器的HTTP端口,默认为8080 port: 8080 + #port: 6061 servlet: # 应用的访问路径 context-path: / @@ -65,7 +66,7 @@ spring: # 数据库索引 database: 0 # 密码 - password: sdust2020 + password: '*&jkjusWETO(^ses%i' # 连接超时时间 timeout: 10s lettuce: @@ -134,3 +135,4 @@ xss: excludes: /system/notice/* # 匹配链接 urlPatterns: /system/*,/monitor/*,/tool/* + diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysRegisterService.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysRegisterService.java index c7de444ee..e12c89d2f 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysRegisterService.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysRegisterService.java @@ -41,12 +41,12 @@ public class SysRegisterService { String msg = "", username = registerBody.getUsername(), password = registerBody.getPassword(); - boolean captchaOnOff = configService.selectCaptchaOnOff(); - // 验证码开关 - if (captchaOnOff) - { - validateCaptcha(username, registerBody.getCode(), registerBody.getUuid()); - } +// boolean captchaOnOff = configService.selectCaptchaOnOff(); +// // 验证码开关 +// if (captchaOnOff) +// { +// validateCaptcha(username, registerBody.getCode(), registerBody.getUuid()); +// } if (StringUtils.isEmpty(username)) { @@ -56,16 +56,16 @@ public class SysRegisterService { msg = "用户密码不能为空"; } - else if (username.length() < UserConstants.USERNAME_MIN_LENGTH - || username.length() > UserConstants.USERNAME_MAX_LENGTH) - { - msg = "账户长度必须在2到20个字符之间"; - } - else if (password.length() < UserConstants.PASSWORD_MIN_LENGTH - || password.length() > UserConstants.PASSWORD_MAX_LENGTH) - { - msg = "密码长度必须在5到20个字符之间"; - } +// else if (username.length() < UserConstants.USERNAME_MIN_LENGTH +// || username.length() > UserConstants.USERNAME_MAX_LENGTH) +// { +// msg = "账户长度必须在2到20个字符之间"; +// } +// else if (password.length() < UserConstants.PASSWORD_MIN_LENGTH +// || password.length() > UserConstants.PASSWORD_MAX_LENGTH) +// { +// msg = "密码长度必须在5到20个字符之间"; +// } else if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(username))) { msg = "保存用户'" + username + "'失败,注册账号已存在"; @@ -89,7 +89,6 @@ public class SysRegisterService } return msg; } - /** * 校验验证码 *