提交 436dfcc1 authored 作者: hzh's avatar hzh

bug修复

上级 1e25fa7a
...@@ -57,9 +57,10 @@ public interface RemoteUserService { ...@@ -57,9 +57,10 @@ public interface RemoteUserService {
* 通过openid查询用户信息 * 通过openid查询用户信息
* *
* @param openid openid * @param openid openid
* @param tenantId 租户id
* @return 结果 * @return 结果
*/ */
XcxLoginUser getUserInfoByOpenid(String openid) throws UserException; XcxLoginUser getUserInfoByOpenid(String openid, String tenantId) throws UserException;
/** /**
* 注册用户信息 * 注册用户信息
......
...@@ -57,7 +57,7 @@ public class XcxAuthStrategy implements IAuthStrategy { ...@@ -57,7 +57,7 @@ public class XcxAuthStrategy implements IAuthStrategy {
// 校验 appid + appsrcret + xcxCode 调用登录凭证校验接口 获取 session_key 与 openid // 校验 appid + appsrcret + xcxCode 调用登录凭证校验接口 获取 session_key 与 openid
String openid = auth.getOpenId(); String openid = auth.getOpenId();
XcxLoginUser loginUser = remoteUserService.getUserInfoByOpenid(openid); XcxLoginUser loginUser = remoteUserService.getUserInfoByOpenid(openid, loginBody.getClientId());
// 用户不存在 返回 openid // 用户不存在 返回 openid
if (loginUser == null) { if (loginUser == null) {
......
...@@ -56,7 +56,7 @@ public class XcxPhoneAuthStrategy implements IAuthStrategy { ...@@ -56,7 +56,7 @@ public class XcxPhoneAuthStrategy implements IAuthStrategy {
.setTenantId(loginBody.getTenantId()) .setTenantId(loginBody.getTenantId())
.setOpenId(loginBody.getOpenId()) .setOpenId(loginBody.getOpenId())
.setPhonenumber(phone)); .setPhonenumber(phone));
XcxLoginUser loginUser = remoteUserService.getUserInfoByOpenid(loginBody.getOpenId()); XcxLoginUser loginUser = remoteUserService.getUserInfoByOpenid(loginBody.getOpenId(), loginBody.getTenantId());
if (loginUser == null) { if (loginUser == null) {
throw new RuntimeException("用户不存在"); throw new RuntimeException("用户不存在");
......
...@@ -152,8 +152,8 @@ public class RemoteUserServiceImpl implements RemoteUserService { ...@@ -152,8 +152,8 @@ public class RemoteUserServiceImpl implements RemoteUserService {
* @return 结果 * @return 结果
*/ */
@Override @Override
public XcxLoginUser getUserInfoByOpenid(String openid) throws UserException { public XcxLoginUser getUserInfoByOpenid(String openid, String tenantId) throws UserException {
WxUserVo wxUser = wxUserService.selectUserByOpenId(openid); WxUserVo wxUser = wxUserService.selectUserByOpenId(openid, tenantId);
if (!ObjectUtil.isNotNull(wxUser)) { if (!ObjectUtil.isNotNull(wxUser)) {
return null; return null;
} }
......
...@@ -14,9 +14,10 @@ public interface IWxUserService { ...@@ -14,9 +14,10 @@ public interface IWxUserService {
* 通过openId查询用户 * 通过openId查询用户
* *
* @param openId openId * @param openId openId
* @param tenantId 租户ID
* @return 用户对象信息 * @return 用户对象信息
*/ */
WxUserVo selectUserByOpenId(String openId); WxUserVo selectUserByOpenId(String openId,String tenantId);
/** /**
* 注册用户 * 注册用户
......
...@@ -28,11 +28,12 @@ public class WxUserServiceImpl implements IWxUserService { ...@@ -28,11 +28,12 @@ public class WxUserServiceImpl implements IWxUserService {
* 通过openId查询用户 * 通过openId查询用户
* *
* @param openId openId * @param openId openId
* @param tenantId tenantId
* @return 用户对象信息 * @return 用户对象信息
*/ */
@Override @Override
public WxUserVo selectUserByOpenId(String openId) { public WxUserVo selectUserByOpenId(String openId, String tenantId) {
return baseMapper.selectVoOne(new LambdaQueryWrapper<WxUser>().eq(WxUser::getOpenId, openId)); return baseMapper.selectVoOne(new LambdaQueryWrapper<WxUser>().eq(WxUser::getOpenId, openId).eq(WxUser::getTenantId, tenantId));
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论