feat: 去除用户相关数据加密
This commit is contained in:
+2
-23
@@ -223,16 +223,8 @@ public class SysUserController {
|
||||
*/
|
||||
private void setUserInfo(String rsaPrivateKey, SysUser user) {
|
||||
try {
|
||||
if (StrUtil.isNotEmpty(user.getEmail())){
|
||||
String email = CommonUtils.decryptBtRsaPriKey(user.getEmail(), rsaPrivateKey);
|
||||
user.setEmail(email);
|
||||
}
|
||||
|
||||
if (StrUtil.isNotEmpty(user.getPhone())){
|
||||
String phone = CommonUtils.decryptBtRsaPriKey(user.getPhone(), rsaPrivateKey);
|
||||
user.setPhone(phone);
|
||||
}
|
||||
|
||||
user.setEmail(user.getEmail());
|
||||
user.setPhone(user.getPhone());
|
||||
// 密码加盐
|
||||
String password = CommonUtils.decryptBtRsaPriKey(user.getPassword(), rsaPrivateKey);
|
||||
user.setCreateTime(new Date());//设置创建时间
|
||||
@@ -277,19 +269,6 @@ public class SysUserController {
|
||||
SysUser user = JSON.parseObject(jsonObject.toJSONString(), SysUser.class);
|
||||
String email = null;
|
||||
String phone = null;
|
||||
try {
|
||||
//1:先用私钥解密数据
|
||||
if (StrUtil.isNotEmpty(user.getEmail())){
|
||||
email = CommonUtils.decryptBtRsaPriKey(user.getEmail(), rsaPrivateKey);
|
||||
}
|
||||
|
||||
if (StrUtil.isNotEmpty(user.getPhone())){
|
||||
phone = CommonUtils.decryptBtRsaPriKey(user.getPhone(), rsaPrivateKey);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new JeroBootException("解密失败!", e);
|
||||
}
|
||||
// 3:把数据加密在放回来
|
||||
user.setEmail(email);
|
||||
user.setPhone(phone);
|
||||
user.setUpdateTime(new Date());
|
||||
|
||||
Reference in New Issue
Block a user