fix 新增用户时没有处理邮箱密码
This commit is contained in:
+3
@@ -293,10 +293,12 @@ public class SysUserController {
|
||||
String rsaPrivateKey = String.valueOf(redisUtil.get(rsaPublicKey));
|
||||
SysUser user = JSON.parseObject(jsonObject.toJSONString(), SysUser.class);
|
||||
String email;
|
||||
String emailPassword;
|
||||
String phone;
|
||||
try {
|
||||
//1:先用私钥解密数据
|
||||
email = CommonUtils.decryptBtRsaPriKey(user.getEmail(), rsaPrivateKey);
|
||||
emailPassword = CommonUtils.decryptBtRsaPriKey(user.getEmailPassword(), rsaPrivateKey);
|
||||
phone = CommonUtils.decryptBtRsaPriKey(user.getPhone(), rsaPrivateKey);
|
||||
} catch (Exception e) {
|
||||
throw new JeroBootException("解密失败!", e);
|
||||
@@ -308,6 +310,7 @@ public class SysUserController {
|
||||
//3:把数据加密在放回来
|
||||
user.setEmail(PasswordUtil.encrypt(email));
|
||||
user.setPhone(PasswordUtil.encrypt(phone));
|
||||
user.setEmailPassword(PasswordUtil.encrypt(emailPassword));
|
||||
if (!confirmPassword.equals(user.getPassword())) {
|
||||
throw new JeroBootException("两次密码输入不一致");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user