记得上下班打卡 | git大法好,push需谨慎

Commit 0de03231 authored by 姜秀龙's avatar 姜秀龙

fix(adam): QQ 换 openId 仅在 login/tpa 注册流程换绑

从 user/tpa/bind 撤回 QQ 特判;在 register(AdamThirdPartParam) 中手机号已注册且已绑 QQ 但 openId 变化时解绑后重绑,新 openId 已被他人占用则返回 10007。

Made-with: Cursor
parent ca543ba2
......@@ -340,18 +340,6 @@ public class AdamUserController {
String currentUid = CurrentUtil.getCurrentUid();
// QQ 特殊场景:openId 变更时允许“无感知”替换绑定(仅限当前 uid 自己的 QQ 绑定)
// 先解绑当前 uid 旧的 QQ,再绑定新的 QQ openId,避免命中“已绑定同类型”限制(10008)
if ("QQ".equals(parameter.getPlatform())) {
AdamThirdPartInfoVo currentQq = adamRdmService.getThirdPartVoByUidPlatform(currentUid, parameter.getPlatform());
if (null != currentQq) {
if (parameter.getOpenId().equals(currentQq.getOpenId())) {
return ResponseDto.success(adamRdmService.getThirdPartVoListByUid(currentUid));
}
adamUserService.unBindTpa(currentUid, parameter.getPlatform());
}
}
String existUid = adamRdmService.getUidByPlatformOpenId(parameter.getPlatform(), parameter.getOpenId());
if (StringUtils.isNotEmpty(existUid)) {
if (existUid.equals(currentUid)) {
......
......@@ -205,7 +205,21 @@ public class AdamUserServiceImpl implements IAdamUserService {
} else if (thirdPartVo.getOpenId().equals(param.getOpenId())) {
userInfoVo = adamRdmService.getUserInfoVoByUid(uid);
} else {
return ResponseDto.failure(ErrorMapping.get("10010"));
// login/tpa 带手机号:仅 QQ 允许同一 uid 下 openId 变更时无感知换绑;其它平台仍走原校验
if (!"QQ".equals(param.getPlatform())) {
return ResponseDto.failure(ErrorMapping.get("10010"));
}
String existUidForOpenId = adamRdmService.getUidByPlatformOpenId(param.getPlatform(), param.getOpenId());
if (StringUtils.isNotEmpty(existUidForOpenId) && !existUidForOpenId.equals(uid)) {
return ResponseDto.failure(ErrorMapping.get("10007"));
}
userInfoVo = adamRdmService.getUserInfoVoByUid(uid);
if (null == userInfoVo || userInfoVo.getState() == 2) {
log.warn("Cancelled mobile:{}", param.getMobile());
return ResponseDto.failure(ErrorMapping.get("10024"));
}
this.unBindTpa(uid, param.getPlatform());
this.bindTpa(uid, param);
}
}
return ResponseDto.success(userInfoVo);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment