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

bug修复

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