mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-27 01:32:03 +08:00
完善多租户的注释与代码
This commit is contained in:
parent
b73cdd15b5
commit
034de50999
@ -12,7 +12,8 @@ import lombok.Getter;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public enum DocumentEnum {
|
public enum DocumentEnum {
|
||||||
|
|
||||||
REDIS_INSTALL("https://gitee.com/zhijiantianya/ruoyi-vue-pro/issues/I4VCSJ", "Redis 安装文档");
|
REDIS_INSTALL("https://gitee.com/zhijiantianya/ruoyi-vue-pro/issues/I4VCSJ", "Redis 安装文档"),
|
||||||
|
TENANT("https://doc.iocoder.cn", "SaaS 多租户文档");
|
||||||
|
|
||||||
private final String url;
|
private final String url;
|
||||||
private final String memo;
|
private final String memo;
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package cn.iocoder.yudao.framework.tenant.core.context;
|
package cn.iocoder.yudao.framework.tenant.core.context;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.enums.DocumentEnum;
|
||||||
import com.alibaba.ttl.TransmittableThreadLocal;
|
import com.alibaba.ttl.TransmittableThreadLocal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -36,7 +37,8 @@ public class TenantContextHolder {
|
|||||||
public static Long getRequiredTenantId() {
|
public static Long getRequiredTenantId() {
|
||||||
Long tenantId = getTenantId();
|
Long tenantId = getTenantId();
|
||||||
if (tenantId == null) {
|
if (tenantId == null) {
|
||||||
throw new NullPointerException("TenantContextHolder 不存在租户编号"); // TODO 芋艿:增加文档链接
|
throw new NullPointerException("TenantContextHolder 不存在租户编号!可参考文档:"
|
||||||
|
+ DocumentEnum.TENANT.getUrl());
|
||||||
}
|
}
|
||||||
return tenantId;
|
return tenantId;
|
||||||
}
|
}
|
||||||
|
@ -28,8 +28,6 @@ import java.util.Objects;
|
|||||||
* 2. 如果请求未带租户的编号,检查是否是忽略的 URL,否则也不允许访问。
|
* 2. 如果请求未带租户的编号,检查是否是忽略的 URL,否则也不允许访问。
|
||||||
* 3. 校验租户是合法,例如说被禁用、到期
|
* 3. 校验租户是合法,例如说被禁用、到期
|
||||||
*
|
*
|
||||||
* 校验用户访问的租户,是否是其所在的租户,
|
|
||||||
*
|
|
||||||
* @author 芋道源码
|
* @author 芋道源码
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
Loading…
Reference in New Issue
Block a user