pull/16/head
perry 2023-05-26 10:24:35 +08:00
parent 6ce6a7a3fa
commit 8cfba0d856
2 changed files with 4 additions and 2 deletions

View File

@ -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;
}

View File

@ -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;
}