diff --git a/src/stores/user.ts b/src/stores/user.ts index 54f52f2..a86a15d 100644 --- a/src/stores/user.ts +++ b/src/stores/user.ts @@ -13,6 +13,9 @@ export interface AdminCheckResult { is_tenant_admin?: boolean current_role_name?: string current_role_uuid?: string + current_company_uuid?: string + current_tenant_uuid?: string + has_current_company?: boolean role_scope?: { Type?: string TypeLabel?: string diff --git a/src/views/company/TenantDetail.vue b/src/views/company/TenantDetail.vue index 3a1cf46..7ed0893 100644 --- a/src/views/company/TenantDetail.vue +++ b/src/views/company/TenantDetail.vue @@ -27,13 +27,16 @@ import EntityPicker from '@/components/EntityPicker.vue' import { formApi } from '@/api/form' import { setPageTitle } from '@/utils/serverScope' import { formatUtcTime as formatTime } from '@/utils/dateTime' +import { useUserStore } from '@/stores/user' import type { ColumnSchema } from '@/types/api' const route = useRoute() const router = useRouter() +const userStore = useUserStore() // 路由参数:租户 UUID(computed 响应式:同一 tab 复用且 query 变化时自动更新) -const tenantUUID = computed(() => (route.query.TenantUUID as string) || '') +// 无 query 参数(从"租户管理 > 租户管理详情"菜单直达)时回退到当前角色的租户 UUID +const tenantUUID = computed(() => (route.query.TenantUUID as string) || userStore.adminCheck?.current_tenant_uuid || '') // === 状态 === const loading = ref(false)