feat: 去除用户相关数据加密
This commit is contained in:
+2
-23
@@ -223,16 +223,8 @@ public class SysUserController {
|
|||||||
*/
|
*/
|
||||||
private void setUserInfo(String rsaPrivateKey, SysUser user) {
|
private void setUserInfo(String rsaPrivateKey, SysUser user) {
|
||||||
try {
|
try {
|
||||||
if (StrUtil.isNotEmpty(user.getEmail())){
|
user.setEmail(user.getEmail());
|
||||||
String email = CommonUtils.decryptBtRsaPriKey(user.getEmail(), rsaPrivateKey);
|
user.setPhone(user.getPhone());
|
||||||
user.setEmail(email);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (StrUtil.isNotEmpty(user.getPhone())){
|
|
||||||
String phone = CommonUtils.decryptBtRsaPriKey(user.getPhone(), rsaPrivateKey);
|
|
||||||
user.setPhone(phone);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 密码加盐
|
// 密码加盐
|
||||||
String password = CommonUtils.decryptBtRsaPriKey(user.getPassword(), rsaPrivateKey);
|
String password = CommonUtils.decryptBtRsaPriKey(user.getPassword(), rsaPrivateKey);
|
||||||
user.setCreateTime(new Date());//设置创建时间
|
user.setCreateTime(new Date());//设置创建时间
|
||||||
@@ -277,19 +269,6 @@ public class SysUserController {
|
|||||||
SysUser user = JSON.parseObject(jsonObject.toJSONString(), SysUser.class);
|
SysUser user = JSON.parseObject(jsonObject.toJSONString(), SysUser.class);
|
||||||
String email = null;
|
String email = null;
|
||||||
String phone = 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.setEmail(email);
|
||||||
user.setPhone(phone);
|
user.setPhone(phone);
|
||||||
user.setUpdateTime(new Date());
|
user.setUpdateTime(new Date());
|
||||||
|
|||||||
Reference in New Issue
Block a user