diff --git a/etc/brick-types.api.md b/etc/brick-types.api.md index f7e52d7bb6..6cc142b460 100644 --- a/etc/brick-types.api.md +++ b/etc/brick-types.api.md @@ -4,11 +4,11 @@ ```ts -import { History as History_2 } from 'history'; +import type { History as History_2 } from 'history'; import { IconName } from '@fortawesome/fontawesome-svg-core'; import { IconPrefix } from '@fortawesome/fontawesome-svg-core'; -import { Key } from 'path-to-regexp'; -import { Location as Location_2 } from 'history'; +import type { Key } from 'path-to-regexp'; +import type { Location as Location_2 } from 'history'; import { LocationDescriptor } from 'history'; import { ThemeType } from '@ant-design/compatible/lib/icon'; @@ -2531,21 +2531,10 @@ export interface StoryDocTypeParameter { type: string; } +// Warning: (ae-incompatible-release-tags) The symbol "SystemInfo" is marked as @public, but its signature references "AuthInfo" which is marked as @internal +// // @public -export interface SystemInfo extends RuntimeMisc { - // (undocumented) - accessRule?: string; - // (undocumented) - isAdmin?: boolean; - // (undocumented) - loginFrom?: string; - // (undocumented) - org: number; - // (undocumented) - userInstanceId: string; - // (undocumented) - username: string; -} +export type SystemInfo = AuthInfo & RuntimeMisc; // @public (undocumented) export type TemplateLayoutType = "wrapper"; diff --git a/packages/brick-kit/src/core/LocationContext.ts b/packages/brick-kit/src/core/LocationContext.ts index 47eefe7e0a..abaff20c6b 100644 --- a/packages/brick-kit/src/core/LocationContext.ts +++ b/packages/brick-kit/src/core/LocationContext.ts @@ -194,7 +194,6 @@ export class LocationContext { tplContextId?: string; formContextId?: string; }): PluginRuntimeContext { - const auth = getAuth(); const context: PluginRuntimeContext = { hash: this.location.hash, pathname: this.location.pathname, @@ -202,12 +201,7 @@ export class LocationContext { match, app: this.kernel.nextApp, sys: { - org: auth.org, - username: auth.username, - userInstanceId: auth.userInstanceId, - loginFrom: auth.loginFrom, - accessRule: auth.accessRule, - isAdmin: auth.isAdmin, + ...getAuth(), ...getRuntimeMisc(), }, flags: this.kernel.getFeatureFlags(), diff --git a/packages/brick-types/src/runtime.ts b/packages/brick-types/src/runtime.ts index 964f6758ed..ab3caa84cb 100644 --- a/packages/brick-types/src/runtime.ts +++ b/packages/brick-types/src/runtime.ts @@ -1,14 +1,15 @@ -import { Key } from "path-to-regexp"; -import { History, Location, LocationDescriptor } from "history"; -import { +import type { Key } from "path-to-regexp"; +import type { History, Location, LocationDescriptor } from "history"; +import type { BreadcrumbItemConf, MicroApp, BrickConf, FeatureFlags, SeguesConf, BrickEventHandler, + AuthInfo, } from "./manifest"; -import { SidebarMenu, SidebarSubMenu } from "./menu"; +import type { SidebarMenu, SidebarSubMenu } from "./menu"; /** @internal */ export interface CompileOptions { @@ -44,14 +45,7 @@ export interface MatchParams { /** * 系统会话信息。 */ -export interface SystemInfo extends RuntimeMisc { - org: number; - username: string; - userInstanceId: string; - loginFrom?: string; - accessRule?: string; - isAdmin?: boolean; -} +export type SystemInfo = AuthInfo & RuntimeMisc; /** * 运行时杂项信息。