提交 178a3566 编写于 作者: dong.an's avatar dong.an

一个账号只能绑定一个微信号

上级 7f2928f6
流水线 #18386 已失败 于阶段
in 0 second
......@@ -26,7 +26,8 @@ public enum AccountExceptionEnum {
PICA_SYSCODE_RETRY("216518", "请X秒后重试"),
PICA_NOT_EXIST("216519", "该用户不存在"),
PICA_REGISTER_FAIL("216520", "注册失败"),
PICA_WECHAT_CODE_ERROR("216521", "微信登录授权code不正确");
PICA_WECHAT_CODE_ERROR("216521", "微信登录授权code不正确"),
PICA_WECHAT_BIND_ERROR("216522", "该手机已绑定另一微信号");
private String code;
......
......@@ -34,5 +34,7 @@ public interface AccountUnionMapper {
int updateByPrimaryKey(AccountUnionEntity record);
AccountUnionEntity selectByAcctId(int acctId);
}
\ No newline at end of file
......@@ -255,6 +255,11 @@ public class LoginServiceImpl implements LoginService {
}
}
} else {
//账号存在的情况下,判断是否已经绑定过微信
AccountUnionEntity exist = accountUnionMapper.selectByAcctId(accountInfoEntity.getId());
if (exist != null && !exist.getUnionId().equals(request.getUnionId())) {
throw new PicaException(AccountExceptionEnum.PICA_WECHAT_BIND_ERROR.getCode(), AccountExceptionEnum.PICA_WECHAT_BIND_ERROR.getMessage());
}
result = processLogin(request, accountInfoEntity.getId(), AccountTypeEnum.LOGIN_WE_CHAT.getCode());
}
result.setMobile(request.getMobile());
......
......@@ -159,4 +159,12 @@
modified_time = #{modifiedTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectByAcctId" resultMap="BaseResultMap" parameterType="java.lang.Integer">
select
<include refid="Base_Column_List"/>
from account_union
where acct_id = #{acctId} and delete_flag = 1
limit 1
</select>
</mapper>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册