xto-fronted 0.4.109 → 0.4.111

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,7 +7,12 @@
7
7
  */
8
8
  /**
9
9
  * 加载运行时配置
10
- * 生产环境从 config.json 加载,开发环境跳过
10
+ * 仅在生产部署环境加载 config.json,开发环境自动跳过
11
+ *
12
+ * 注意:不能使用 import.meta.env.PROD 判断,因为作为 npm 库构建时
13
+ * Vite 会将 import.meta.env.PROD 静态替换为 true,导致开发环境也会尝试加载
14
+ * 改用 window.location 协议判断:file:// 或 localhost 开发服务器视为开发环境
15
+ *
11
16
  * @param basePath 应用基础路径,如 '/admin' 或 '/sea'
12
17
  */
13
18
  export declare function loadRuntimeConfig(basePath?: string): Promise<Record<string, string>>;
@@ -19,6 +24,7 @@ export declare function initAppConfig(config: {
19
24
  appId?: string;
20
25
  clientId?: string;
21
26
  apiBaseUrl?: string;
27
+ basePath?: string;
22
28
  }): void;
23
29
  /**
24
30
  * 获取 AppId
@@ -33,8 +39,13 @@ export declare function getClientId(): string;
33
39
  * 获取 API 基础路径
34
40
  */
35
41
  export declare function getApiBaseUrl(): string;
42
+ /**
43
+ * 获取应用基础路径(用于路由 base)
44
+ */
45
+ export declare function getBasePath(): string;
36
46
  export declare const appConfig: {
37
47
  appId: import('vue').Ref<string, string>;
38
48
  clientId: import('vue').Ref<string, string>;
39
49
  apiBaseUrl: import('vue').Ref<string, string>;
50
+ basePath: import('vue').Ref<string, string>;
40
51
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xto-fronted",
3
- "version": "0.4.109",
3
+ "version": "0.4.111",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "XTO 前端应用框架",