Browse Source

加密方式调整

zsf 1 year ago
parent
commit
3fb7dcfeee

+ 1 - 1
src/main/java/com/rf/psychological/institution/rest/InstitutionController.java

@@ -162,7 +162,7 @@ public class InstitutionController extends BaseController {
         if (userEntity == null) {
             return fail("", "请先注册");
         } else {
-            userEntity.setPassword(DigestUtils.md5DigestAsHex(Constant.DEFAULT_PASSWORD.getBytes(StandardCharsets.UTF_8)));
+            userEntity.setPassword(DigestUtils.md5DigestAsHex(Constant.DEFAULT_PASSWORD.getBytes()));
             userEntity.setUserStatus(UserStatus.UPDATE.getType());
             userService.save(userEntity);
             return success();

+ 1 - 0
src/main/java/com/rf/psychological/institution/service/impl/InstitutionServiceImpl.java

@@ -105,6 +105,7 @@ public class InstitutionServiceImpl implements InstitutionService {
                         item.get("loginName").toString(), DigestUtils.md5DigestAsHex(item.get("password").toString().getBytes()),
                         LocalDate.now().toString(),Constant.DEFAULT_VALUE_ZERO, UserStatus.PASS.getType(), UserRole.SUPERADMIN.getType());
                         institutionUserEntity.setCreateTime(DateUtil.now());
+                        institutionUserEntity.setStructureNo(institutionNo);
                         userService.save(institutionUserEntity);
             });
         }

+ 1 - 1
src/main/java/com/rf/psychological/rest/ServerController.java

@@ -1087,7 +1087,7 @@ public class ServerController extends BaseController {
                 //姓名、账号、密码格式未效验
                 tempUserDB.setPetName(petName.toString());
                 tempUserDB.setPhone(phone.toString());
-                tempUserDB.setPassword(DigestUtils.md5DigestAsHex(idCardStr.substring(12).getBytes(StandardCharsets.UTF_8)));
+                tempUserDB.setPassword(DigestUtils.md5DigestAsHex(idCardStr.substring(12).getBytes()));
                 tempUserDB.setGender(gender.toString());
                 tempUserDB.setInstitutionNo(institutionNo);
                 tempUserDB.setUserStatus(Constant.USER_STATUS_NORMAL);

+ 1 - 1
src/main/java/com/rf/psychological/user/rest/UserController.java

@@ -354,7 +354,7 @@ public class UserController extends BaseController {
             UserEntity userInfo = this.userService.findPhoneAndInstitutionNoAndRoleType(userEntity.getPhone(), userEntity.getInstitutionNo(),userEntity.getRoleType());
             if (userInfo == null) {
                 String idCardStr = userEntity.getPhone();
-                userEntity.setPassword(DigestUtils.md5DigestAsHex(idCardStr.substring(12).getBytes(StandardCharsets.UTF_8)));
+                userEntity.setPassword(DigestUtils.md5DigestAsHex(idCardStr.substring(12).getBytes()));
                 userEntity.setUserStatus(Constant.USER_STATUS_NORMAL);
                 userEntity.setRoleType(UserRole.COMMON.getType());
                 userEntity.setBirthday(idCardStr.substring(6,10)+"-"+idCardStr.substring(10,12)+"-"+idCardStr.substring(12,14));