|
|
@@ -81,13 +81,22 @@ public class UserIdentCertServiceImpl implements UserIdentCertService {
|
|
|
String bindState = indentCertReq.getBindState();
|
|
|
if (userIdList.size() == 1 && StrUtil.isNotEmpty(bindState)) {
|
|
|
User user = userMapper.selectById(userId);
|
|
|
- //绑定微信端用户
|
|
|
if (StrUtil.isEmpty(user.getOpenId())) {
|
|
|
+ String key = RedisService.key.WX_INDENT_BIND_KEY.getEnvName() + bindState;
|
|
|
+ Object bindInfo = redisService.get(key);
|
|
|
+ if (bindInfo == null) {
|
|
|
+ throw BusinessRuntimeException.getInstance("认证信息已失效,请重新操作..");
|
|
|
+ }
|
|
|
+ Long bindUserId = Long.parseLong(bindInfo.toString());
|
|
|
+ User bindUser = userMapper.selectById(bindUserId);
|
|
|
+ //绑定微信端用户
|
|
|
UserBindInfoReq request = new UserBindInfoReq();
|
|
|
- request.setType(StrUtil.isNotBlank(user.getLoginPhone()) ? 1 : 2);
|
|
|
+ request.setType(StrUtil.isNotBlank(bindUser.getLoginPhone()) ? 1 : 2);
|
|
|
request.setUserId(userId);
|
|
|
+ request.setAccount(request.getType() == 1 ? bindUser.getLoginPhone() : bindUser.getEmail());
|
|
|
bindTaskService.bindOtherAccount(request);
|
|
|
userIdList = userBindRelationService.getRelationUserIdList(userId, null);
|
|
|
+ redisService.del(key);
|
|
|
}
|
|
|
}
|
|
|
|