feat 优化微信授权的功能

This commit is contained in:
damonyuan
2025-05-30 15:44:13 +08:00
parent 562e59dc96
commit 7f71eafd6e

View File

@@ -448,13 +448,15 @@ public class UserServiceImpl implements IUserService {
// 已有授权,返回已绑定微信。 没有授权,绑定微信 // 已有授权,返回已绑定微信。 没有授权,绑定微信
if (!StringUtils.isBlank(unionId)) { if (!StringUtils.isBlank(unionId)) {
UserAuth userAuthUnionId = userAuthMapper.selectOne(new QueryWrapper<UserAuth>() if (unionId.equals("0") == false) {
.eq("unionid", unionId) UserAuth userAuthUnionId = userAuthMapper.selectOne(new QueryWrapper<UserAuth>()
.last("limit 1")); .eq("unionid", unionId)
.last("limit 1"));
if (userAuthUnionId != null && !userId.equals(userAuthUnionId.getUserId())) { if (userAuthUnionId != null && !userId.equals(userAuthUnionId.getUserId())) {
// 该微信已绑定 // 该微信已绑定
throw new OperateException("该微信已绑定"); throw new OperateException("该微信已绑定");
}
} }
} }