From e14b6608ef5ddb9baf828680a6814b9eaf95ab1a Mon Sep 17 00:00:00 2001 From: perry <292303709@qq.com> Date: Fri, 26 May 2023 13:45:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/member/service/promoter/PromoterServiceImpl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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);