refactor(tenant): refine menu scope boundaries and document plan/tenant menu design

This commit is contained in:
Ray.Hao
2026-01-25 11:15:59 +08:00
parent 3879105e15
commit 3f8393813b
20 changed files with 959 additions and 158 deletions

View File

@@ -3,7 +3,7 @@ import NProgress from "@/plugins/nprogress";
import router from "@/router";
import { usePermissionStore, useUserStore } from "@/store";
import { useTenantStoreHook } from "@/store/modules/tenant";
import { appConfig } from "@/settings";
import { isTenantEnabled } from "@/utils/tenant";
/**
* 路由权限守卫
@@ -89,7 +89,8 @@ export function setupPermissionGuard() {
/** 初始化多租户上下文,未启用或失败时静默跳过 */
async function initTenantContext(): Promise<void> {
if (!appConfig.tenantEnabled) return;
// 多租户关闭时不初始化租户上下文
if (!isTenantEnabled()) return;
try {
await useTenantStoreHook().loadTenant();