提交 af3e6d89 编写于 作者: rushui.chen's avatar rushui.chen

20200109 完善注册接口

上级 e737c645
流水线 #20539 已失败 于阶段
in 0 second
......@@ -106,8 +106,8 @@ public class Test {
System.out.println("--------------------获取验证码接口-------------");
BaseRequest authCode = new BaseRequest();
authCode.setFlag(4);
authCode.setMobile("13024112688");
authCode.setFlag(1);
authCode.setMobile("13024119988");
String authCodeStr = JSONObject.toJSONString(authCode);
System.out.println(authCodeStr);
String contentResult2 = AESUtil.aesEncrypt(authCodeStr, "YCPQPx4qpQjEjDea");
......@@ -121,9 +121,9 @@ public class Test {
//获取注册参数
BaseRequest register = null;
register = new BaseRequest();
register.setMobile("13024112688");
register.setMobile("13024119988");
register.setPassword("D0DCBF0D12A6B1E7FBFA2CE5848F3EFF");
register.setAuthCode("113058");
register.setAuthCode("868578");
String registerString3 = JSONObject.toJSONString(register);
String contentResult3 = AESUtil.aesEncrypt(registerString3, "YCPQPx4qpQjEjDea");
String keyResult3 = RSAUtil.encrypt("YCPQPx4qpQjEjDea",publicKey);
......
......@@ -111,46 +111,35 @@ public class RegisterServiceImpl implements RegisterService {
accountInfoDetailMapper.insertSelective(accountInfo);
Integer acctId = accountInfo.getId();
accountInfoDetailMapper.updateCreateInfo(acctId);
if (productType == AccountTypeEnum.PRODUCT_TYPE_HEALTH.getCode()) {
AccountPatientInfoEntity accountPatientInfoEntity = new AccountPatientInfoEntity();
accountPatientInfoEntity.setAcctId(acctId);
accountPatientInfoEntity.setDeleteFlag(1);
accountPatientInfoEntity.setCreateId(acctId);
accountPatientInfoEntity.setModifyId(acctId);
accountPatientInfoEntity.setCreateTime(currentTime);
accountPatientInfoEntity.setModifyTime(currentTime);
accountUserInfoMapper.insertSelective(accountPatientInfoEntity);
} else {
Account account = new Account();
account.setAcctId(acctId);
account.setMobilePhone(mobileEncrypt);
account.setDeleteFlag(1);
account.setCreatId(0L);
account.setModifyId(0L);
account.setCreatTime(currentTime);
account.setModifyTime(currentTime);
account.setFirstLoginTime(currentTime);
account.setLastLoginTime(currentTime);
account.setRegisterSource(sourceType);
account.setPassword(password);
if (!StringUtils.isBlank(password)){
account.setEntireFlag(3);
}
accountMapper.insertSelective(account);
}
Long userId = accountUtils.getUserIdByAcctId(productType, acctId);
Account account = new Account();
account.setId(userId);
account.setAcctId(acctId);
account.setMobilePhone(mobileEncrypt);
account.setDeleteFlag(1);
account.setCreatId(0L);
account.setModifyId(0L);
account.setCreatTime(currentTime);
account.setMobilePhone(mobile);
account.setModifyTime(currentTime);
account.setFirstLoginTime(currentTime);
account.setLastLoginTime(currentTime);
account.setRegisterSource(sourceType);
String newToken = tokenUtils.generateToken(account);
account.setPassword(password);
if (!StringUtils.isBlank(password)) {
account.setEntireFlag(3);
}
accountMapper.insertSelective(account);
Long userId = account.getId();
Account accountToken = new Account();
accountToken.setId(userId);
accountToken.setAcctId(acctId);
accountToken.setCreatTime(currentTime);
accountToken.setMobilePhone(mobile);
accountToken.setRegisterSource(sourceType);
String newToken = tokenUtils.generateToken(accountToken);
LoginResult result = new LoginResult();
result.setToken(newToken);
result.setUserId(userId);
result.setEntireFlag(1);
result.setDoctorId(EncryptUtils.encryptContent(userId+"", EncryptConstants.ENCRYPT_TYPE_ID));
result.setDoctorId(EncryptUtils.encryptContent(userId + "", EncryptConstants.ENCRYPT_TYPE_ID));
result.setMobile(mobile);
/* ByteArrayOutputStream bos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(bos);
......@@ -179,12 +168,13 @@ public class RegisterServiceImpl implements RegisterService {
throw new AccountException(AccountExceptionEnum.PICA_ALREADY_REGISTER);
}
} else {
throw new AccountException(AccountExceptionEnum.PICA_ALREADY_REGISTER);
throw new AccountException(AccountExceptionEnum.PICA_ALREADY_REGISTER);
}
}
/**
* 异步处理用户角色
*
* @param userId
*/
private void processRoleMap(Long userId) {
......
......@@ -17,7 +17,7 @@ public class RegisterCodeKeyUtils {
* @return
*/
public static String getRegisterKey(String mobilePhone, String authCode) {
return AUTH_CODE_PREFIX + AESUtil.encryptV0(mobilePhone) + authCode;
return AUTH_CODE_PREFIX + AESUtil.encryptV0(mobilePhone) +"-"+ authCode;
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册