提交 37c87e11 编写于 作者: xinxu.wang's avatar xinxu.wang

加解密

上级 64c7a5f0
流水线 #14146 已失败 于阶段
in 0 second
...@@ -179,7 +179,7 @@ public class AccountController extends AccountBaseController { ...@@ -179,7 +179,7 @@ public class AccountController extends AccountBaseController {
//获取验证码redis key //获取验证码redis key
private String getAuthCodeKey(String mobilePhone, String flag) { private String getAuthCodeKey(String mobilePhone, String flag) {
return AUTH_CODE_PREFIX + flag + "-" + EncryptUtils.encryptContent(mobilePhone, EncryptConstants.Encrypt_type_mobile_1); return AUTH_CODE_PREFIX + flag + "-" + EncryptUtils.encryptContent(mobilePhone, EncryptConstants.ENCRYPT_TYPE_MOBILE);
} }
//校验验证码 //校验验证码
...@@ -224,7 +224,7 @@ public class AccountController extends AccountBaseController { ...@@ -224,7 +224,7 @@ public class AccountController extends AccountBaseController {
picaUser.setToken(newToken); picaUser.setToken(newToken);
picaUser.setId(account.getId().intValue()); picaUser.setId(account.getId().intValue());
picaUser.setMobile(account.getMobilePhone()); picaUser.setMobile(account.getMobilePhone());
picaUser.setName(EncryptUtils.decryptContent(account.getMobilePhone(), EncryptConstants.Encrypt_type_mobile_1, EncryptConstants.encrypt_decrypt_key).replaceAll("(\\d{3})\\d{4}(\\w{4})","$1****$2")); picaUser.setName(EncryptUtils.decryptContent(account.getMobilePhone(), EncryptConstants.ENCRYPT_TYPE_MOBILE, EncryptConstants.ENCRYPT_DECRYPT_KEY).replaceAll("(\\d{3})\\d{4}(\\w{4})","$1****$2"));
picaUser.setCreated_time(account.getCreatTime()); picaUser.setCreated_time(account.getCreatTime());
Map<String, String> data = Object2Map.objectToMapString("yyyy-MM-dd HH:mm:ss", picaUser, new String[0]); Map<String, String> data = Object2Map.objectToMapString("yyyy-MM-dd HH:mm:ss", picaUser, new String[0]);
data.put("sysCode", "h5"); data.put("sysCode", "h5");
......
...@@ -44,7 +44,7 @@ public class AccountServiceImpl implements AccountService { ...@@ -44,7 +44,7 @@ public class AccountServiceImpl implements AccountService {
//根据手机号获取账号 //根据手机号获取账号
@Override @Override
public Account getByMobilePhone(String mobilePhone) { public Account getByMobilePhone(String mobilePhone) {
String encryptMobilePhone = EncryptUtils.encryptContent(mobilePhone, EncryptConstants.Encrypt_type_mobile_1); String encryptMobilePhone = EncryptUtils.encryptContent(mobilePhone, EncryptConstants.ENCRYPT_TYPE_MOBILE);
return accountMapper.getByMobilePhone(encryptMobilePhone); return accountMapper.getByMobilePhone(encryptMobilePhone);
} }
...@@ -58,7 +58,7 @@ public class AccountServiceImpl implements AccountService { ...@@ -58,7 +58,7 @@ public class AccountServiceImpl implements AccountService {
@Transactional @Transactional
public void createAccount(Account account) { public void createAccount(Account account) {
Date currentTime = new Date(); Date currentTime = new Date();
account.setMobilePhone(EncryptUtils.encryptContent(account.getMobilePhone(), EncryptConstants.Encrypt_type_mobile_1)); //手机号加密 account.setMobilePhone(EncryptUtils.encryptContent(account.getMobilePhone(), EncryptConstants.ENCRYPT_TYPE_MOBILE)); //手机号加密
account.setDeleteFlag(1); account.setDeleteFlag(1);
account.setCreatId(0L); account.setCreatId(0L);
account.setModifyId(0L); account.setModifyId(0L);
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册