From 8cfba0d8566dafa58a0a094066dabbf15a07d799 Mon Sep 17 00:00:00 2001 From: perry <292303709@qq.com> Date: Fri, 26 May 2023 10:24:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E6=88=B7id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../framework/tenant/core/context/TenantContextHolder.java | 4 ++-- .../module/member/service/user/MemberUserServiceImpl.java | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/context/TenantContextHolder.java b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/context/TenantContextHolder.java index 93a17b376..c16336992 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/context/TenantContextHolder.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/context/TenantContextHolder.java @@ -37,8 +37,8 @@ public class TenantContextHolder { public static Long getRequiredTenantId() { Long tenantId = getTenantId(); if (tenantId == null) { - throw new NullPointerException("TenantContextHolder 不存在租户编号!可参考文档:" - + DocumentEnum.TENANT.getUrl()); + throw new NullPointerException("商户id不存在" + ); } return tenantId; } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/user/MemberUserServiceImpl.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/user/MemberUserServiceImpl.java index c5243d4ff..df8bb4bff 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/user/MemberUserServiceImpl.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/user/MemberUserServiceImpl.java @@ -5,6 +5,7 @@ import cn.hutool.core.util.IdUtil; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore; +import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder; import cn.iocoder.yudao.module.infra.api.file.FileApi; import cn.iocoder.yudao.module.member.controller.admin.user.dto.AdminUserQueryDTO; import cn.iocoder.yudao.module.member.controller.app.user.vo.AppUserUpdateMobileReqVO; @@ -104,6 +105,7 @@ public class MemberUserServiceImpl implements MemberUserService { user.setPassword(encodePassword("123456")); // 加密密码 user.setRegisterIp(registerIp); user.setPromoterId(promoterId); + user.setTenantId(TenantContextHolder.getRequiredTenantId()); memberUserMapper.insert(user); return user; }