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

20200116 完善验证码逻辑

上级 a94fcbb7
流水线 #20879 已失败 于阶段
in 0 second
...@@ -177,11 +177,8 @@ public class AutoCodeController extends AccountBaseController { ...@@ -177,11 +177,8 @@ public class AutoCodeController extends AccountBaseController {
@ApiOperation("微信获取验证码") @ApiOperation("微信获取验证码")
@PostMapping(value = "/authCode/get") @PostMapping(value = "/authCode/get")
public PicaResponse getAuthCode(){ public PicaResponse getAuthCode(){
String cacheCode = cacheClient.get("authCode-2-j1VrU5MSc1uuZaEa82ZKfQ=="); String cacheCode = cacheClient.get("authCode-j1VrU5MSc1uuZaEa82ZKfQ==");
return PicaResponse.toResponse(cacheCode); return PicaResponse.toResponse(cacheCode);
} }
} }
...@@ -207,8 +207,8 @@ public class LoginServiceImpl implements LoginService { ...@@ -207,8 +207,8 @@ public class LoginServiceImpl implements LoginService {
WeChatUserInfoEntity weChatUserInfoEntity = WeChatUtils.mergeWechatUserInfo(weChatUserInfo, weChatEntity.getOpenid()); WeChatUserInfoEntity weChatUserInfoEntity = WeChatUtils.mergeWechatUserInfo(weChatUserInfo, weChatEntity.getOpenid());
String unionId = weChatUserInfoEntity.getUnionid(); String unionId = weChatUserInfoEntity.getUnionid();
AccountUnionEntity accountUnionEntity = accountUnionMapper.selectByUnionId(unionId); AccountUnionEntity accountUnionEntity = accountUnionMapper.selectByUnionId(unionId);
//是否绑定逻辑的判断
if (accountUnionEntity != null) { if (accountUnionEntity != null) {
//是否绑定逻辑的判断
Long acctId = accountUnionEntity.getAcctId(); Long acctId = accountUnionEntity.getAcctId();
Long userId = accountUtils.getUserIdByAcctId(request.getProductType(), acctId.intValue()); Long userId = accountUtils.getUserIdByAcctId(request.getProductType(), acctId.intValue());
Account account = new Account(); Account account = new Account();
...@@ -232,6 +232,7 @@ public class LoginServiceImpl implements LoginService { ...@@ -232,6 +232,7 @@ public class LoginServiceImpl implements LoginService {
return result; return result;
} else { } else {
AccountWeChatInfoEntity entity = accountWeChatInfoMapper.selectByUnionId(unionId); AccountWeChatInfoEntity entity = accountWeChatInfoMapper.selectByUnionId(unionId);
//如果微信信息表数据不存在,就把用户信息存储到微信信息表中。
if (entity == null) { if (entity == null) {
processWeChatInfoUser(weChatUserInfoEntity, request.getWeChatLoginType()); processWeChatInfoUser(weChatUserInfoEntity, request.getWeChatLoginType());
} }
...@@ -264,7 +265,7 @@ public class LoginServiceImpl implements LoginService { ...@@ -264,7 +265,7 @@ public class LoginServiceImpl implements LoginService {
result.setMobile(request.getMobile()); result.setMobile(request.getMobile());
AccountInfoEntity accountInfo = accountInfoDetailMapper.selectByMobile(AESUtil.encryptV0(request.getMobile())); AccountInfoEntity accountInfo = accountInfoDetailMapper.selectByMobile(AESUtil.encryptV0(request.getMobile()));
Integer acctId = accountInfo.getId(); Integer acctId = accountInfo.getId();
processAccountUnion(acctId, request.getUnionId()); processAccountUnion(acctId, request.getUnionId(),request.getProductType());
return result; return result;
} }
...@@ -295,7 +296,7 @@ public class LoginServiceImpl implements LoginService { ...@@ -295,7 +296,7 @@ public class LoginServiceImpl implements LoginService {
updateWechatInfoUser(entity, weChatUserInfoEntity); updateWechatInfoUser(entity, weChatUserInfoEntity);
} }
Integer acctId = doctorInfoMapper.getAcctIdByDoctorId(doctorId); Integer acctId = doctorInfoMapper.getAcctIdByDoctorId(doctorId);
processAccountUnion(acctId, unionId); processAccountUnion(acctId, unionId,request.getProductType());
return weChatUserInfoEntity.getNickname(); return weChatUserInfoEntity.getNickname();
} }
...@@ -305,7 +306,11 @@ public class LoginServiceImpl implements LoginService { ...@@ -305,7 +306,11 @@ public class LoginServiceImpl implements LoginService {
* @param acctId * @param acctId
* @param unionId * @param unionId
*/ */
private void processAccountUnion(Integer acctId, String unionId) { private void processAccountUnion(Integer acctId, String unionId,Integer productType) {
//先查询当前产品线是否有记录?
//如果有就更新成delete_flag=2;
//然后在插入
AccountUnionEntity accountUnionEntity = new AccountUnionEntity(); AccountUnionEntity accountUnionEntity = new AccountUnionEntity();
accountUnionEntity.setAcctId(acctId.longValue()); accountUnionEntity.setAcctId(acctId.longValue());
accountUnionEntity.setDeleteFlag(1); accountUnionEntity.setDeleteFlag(1);
......
...@@ -179,27 +179,27 @@ public class AESUtil { ...@@ -179,27 +179,27 @@ public class AESUtil {
* 测试 * 测试
*/ */
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
// String KEY="zJJ$c5md3$yuuhWW"; String KEY="zJJ$c5md3$yuuhWW";
// System.out.println("-------------加密---------"); System.out.println("-------------加密---------");
// String content = "18621903846"; String content = "13024112500";
//
//
// System.out.println("加密前:" + content); System.out.println("加密前:" + content);
// System.out.println("加密密钥和解密密钥:" + KEY); System.out.println("加密密钥和解密密钥:" + KEY);
//
// System.out.println("-------------解密---------"); System.out.println("-------------解密---------");
// String encrypt = aesEncrypt(content, KEY); String encrypt = aesEncrypt(content, KEY);
// System.out.println("加密后:" + encrypt); System.out.println("加密后:" + encrypt);
// String decrypt = aesDecrypt("ieE4wN+GkIxm8S8tSVqTow==", KEY); String decrypt = aesDecrypt("ieE4wN+GkIxm8S8tSVqTow==", KEY);
// System.out.println("解密后:" + decrypt); System.out.println("解密后:" + decrypt);
//请求参数解密处理 //请求参数解密处理
String key="am1pnysCRlz80Rl/eTDj/UE/Pe8zkxb2yP73jvrUWEk3x5/lK9hi104MSmsKbl45cPzJfJXBxO+VeItkA63ZqfaUNA0ezdMd7Ord7rGqvWK+4RqAm1T3Qo3lw/5bT0GwgWMWZBrDr30NHCYLmjg6vwVbv3YCEewwQK+rL7bUXu0="; // String key="am1pnysCRlz80Rl/eTDj/UE/Pe8zkxb2yP73jvrUWEk3x5/lK9hi104MSmsKbl45cPzJfJXBxO+VeItkA63ZqfaUNA0ezdMd7Ord7rGqvWK+4RqAm1T3Qo3lw/5bT0GwgWMWZBrDr30NHCYLmjg6vwVbv3YCEewwQK+rL7bUXu0=";
String decrypt = RSAUtil.decrypt(key,privateKey); // String decrypt = RSAUtil.decrypt(key,privateKey);
System.out.println(decrypt); // System.out.println(decrypt);
String content="d9eKA7DGhNx7295N0g82rqzaUOeAvBeuR2gXtOX3Y+VV3ei+zW0BQn9moQgN4mRT8XIzq3x2n3qiqCuOzcDvrlGC0kIcUClM0gt8xDaBw+haVpMAw/7R4FgWNPeVRL5k"; // String content="d9eKA7DGhNx7295N0g82rqzaUOeAvBeuR2gXtOX3Y+VV3ei+zW0BQn9moQgN4mRT8XIzq3x2n3qiqCuOzcDvrlGC0kIcUClM0gt8xDaBw+haVpMAw/7R4FgWNPeVRL5k";
String result = AESUtil.aesDecrypt(content, decrypt); // String result = AESUtil.aesDecrypt(content, decrypt);
System.out.println(result); // System.out.println(result);
// ArrayList<String> list = new ArrayList<>(); // ArrayList<String> list = new ArrayList<>();
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册