diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/promoter/PromoterServiceImpl.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/promoter/PromoterServiceImpl.java index a0b8708ec..ba044b319 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/promoter/PromoterServiceImpl.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/promoter/PromoterServiceImpl.java @@ -5,6 +5,7 @@ import cn.hutool.core.util.StrUtil; import cn.iocoder.yudao.framework.common.exception.ServiceException; import cn.iocoder.yudao.framework.common.util.validation.ValidationUtils; import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; +import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder; import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO; import cn.iocoder.yudao.module.member.enums.ErrorCodeConstants; import cn.iocoder.yudao.module.member.service.user.MemberUserService; @@ -71,11 +72,11 @@ public class PromoterServiceImpl implements PromoterService { memberUserDO.setMobile(createReqVO.getMobile()); memberUserDO.setStatus(createReqVO.getStatus()); memberUserDO.setPassword(createReqVO.getMobile().substring(createReqVO.getMobile().length() - 6)); - memberUserService.createUserIfAbsent(createReqVO.getMobile(), createReqVO.getNickname(), getClientIP()); + memberUserDO = memberUserService.createUserIfAbsent(createReqVO.getMobile(), createReqVO.getNickname(), getClientIP()); } // 插入 PromoterDO promoter = PromoterConvert.INSTANCE.convert(createReqVO); - promoter.setTenantId(SecurityFrameworkUtils.getLoginUser().getTenantId()); + promoter.setTenantId(TenantContextHolder.getTenantId()); Long count = promoterMapper.selectCount(Wrappers.lambdaQuery(PromoterDO.class).eq(PromoterDO::getUserId, memberUserDO.getId())); if (count > 0) { throw new ServiceException(PROMOTER_EXISTS);