From 17f0c20242c6ee3d35b9ee8f677d747ed012423c Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期五, 02 九月 2022 16:30:20 +0800
Subject: [PATCH] remove 移除maven docker插件 过于老旧功能缺陷大 使用idea自带的docker插件替代

---
 ruoyi-system/src/main/java/com/ruoyi/system/service/SysRegisterService.java |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/SysRegisterService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/SysRegisterService.java
index 5f44991..6d861e0 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/SysRegisterService.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/SysRegisterService.java
@@ -1,5 +1,7 @@
 package com.ruoyi.system.service;
 
+import cn.dev33.satoken.secure.BCrypt;
+import com.ruoyi.common.constant.CacheConstants;
 import com.ruoyi.common.constant.Constants;
 import com.ruoyi.common.constant.UserConstants;
 import com.ruoyi.common.core.domain.entity.SysUser;
@@ -10,8 +12,8 @@
 import com.ruoyi.common.exception.user.CaptchaExpireException;
 import com.ruoyi.common.exception.user.UserException;
 import com.ruoyi.common.utils.MessageUtils;
-import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.ServletUtils;
+import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.redis.RedisUtils;
 import lombok.RequiredArgsConstructor;
 import org.springframework.stereotype.Service;
@@ -41,9 +43,9 @@
         // 鏍¢獙鐢ㄦ埛绫诲瀷鏄惁瀛樺湪
         String userType = UserType.getUserType(registerBody.getUserType()).getUserType();
 
-        boolean captchaOnOff = configService.selectCaptchaOnOff();
+        boolean captchaEnabled = configService.selectCaptchaEnabled();
         // 楠岃瘉鐮佸紑鍏�
-        if (captchaOnOff) {
+        if (captchaEnabled) {
             validateCaptcha(username, registerBody.getCode(), registerBody.getUuid(), request);
         }
 
@@ -53,7 +55,7 @@
         SysUser sysUser = new SysUser();
         sysUser.setUserName(username);
         sysUser.setNickName(username);
-        sysUser.setPassword(SecurityUtils.encryptPassword(password));
+        sysUser.setPassword(BCrypt.hashpw(password));
         sysUser.setUserType(userType);
         boolean regFlag = userService.registerUser(sysUser);
         if (!regFlag) {
@@ -71,7 +73,7 @@
      * @return 缁撴灉
      */
     public void validateCaptcha(String username, String code, String uuid, HttpServletRequest request) {
-        String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid;
+        String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + StringUtils.defaultString(uuid, "");
         String captcha = RedisUtils.getCacheObject(verifyKey);
         RedisUtils.deleteObject(verifyKey);
         if (captcha == null) {

--
Gitblit v1.9.3