@gct-paas/core 0.1.6-dev.17 → 0.1.6-dev.18

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.
Files changed (39) hide show
  1. package/dist/index.esm.min.js +2 -2
  2. package/dist/{redirect-index-B9MFzePa.js → redirect-index-BMaa2Dn9.js} +1 -1
  3. package/es/constants/expression-type/modeCfg.mjs +6 -0
  4. package/es/enums/app-designer/index.d.ts +14 -0
  5. package/es/enums/app-designer/index.mjs +16 -1
  6. package/es/enums/appEnum.d.ts +5 -1
  7. package/es/enums/appEnum.mjs +6 -1
  8. package/es/enums/authActionEnum.d.ts +5 -1
  9. package/es/enums/authActionEnum.mjs +4 -0
  10. package/es/enums/expressionEnum.d.ts +4 -2
  11. package/es/enums/expressionEnum.mjs +2 -0
  12. package/es/enums/globalEnum.d.ts +29 -0
  13. package/es/enums/globalEnum.mjs +31 -1
  14. package/es/global/gct/gct.mjs +3 -5
  15. package/es/index.mjs +5 -4
  16. package/es/interface/i-action-item/i-action-item.d.ts +65 -0
  17. package/es/interface/i-app-context/i-app-context.d.ts +5 -0
  18. package/es/interface/index.d.ts +1 -0
  19. package/es/interface/open-util/i-drawer-options/i-drawer-options.d.ts +298 -0
  20. package/es/interface/open-util/i-modal/i-modal.d.ts +2 -1
  21. package/es/interface/open-util/i-modal-data/i-modal-data.d.ts +3 -3
  22. package/es/interface/open-util/i-modal-options/i-modal-options.d.ts +2 -1
  23. package/es/interface/open-util/i-overlay-controller/i-overlay-controller.d.ts +9 -0
  24. package/es/interface/open-util/index.d.ts +1 -0
  25. package/es/locale/index.d.ts +2 -1
  26. package/es/modules/env-manager/env-manager.d.ts +1 -17
  27. package/es/modules/env-manager/env-manager.interface.d.ts +4 -10
  28. package/es/modules/env-manager/env-manager.interface.mjs +2 -0
  29. package/es/modules/env-manager/env-manager.mjs +10 -33
  30. package/es/modules/env-manager/env-manager.util.d.ts +5 -0
  31. package/es/modules/env-manager/env-manager.util.mjs +11 -0
  32. package/es/modules/env-manager/index.d.ts +1 -0
  33. package/es/modules/env-manager/index.mjs +1 -0
  34. package/es/modules/platform-config/enums/login.enum.d.ts +3 -1
  35. package/es/modules/platform-config/enums/login.enum.mjs +2 -0
  36. package/es/store/global-store.mjs +3 -1
  37. package/es/utils/axios/interceptors.mjs +12 -0
  38. package/es/utils/openUtil/modal/modal.d.ts +1 -1
  39. package/package.json +1 -1
@@ -0,0 +1,298 @@
1
+ import { CSSProperties } from 'vue';
2
+ /**
3
+ * 模态飘窗配置项
4
+ *
5
+ * @author zhanghanrui
6
+ * @date 2024-03-29 13:03:31
7
+ * @export
8
+ * @interface IDrawerOptions
9
+ */
10
+ export interface IDrawerOptions {
11
+ /**
12
+ * 抽屉展开后是否将焦点切换至其 Dom 节点
13
+ *
14
+ * @default true
15
+ * @author zhanghanrui
16
+ * @date 2024-03-29 13:03:51
17
+ * @type {boolean}
18
+ */
19
+ autofocus?: boolean;
20
+ /**
21
+ * 可用于设置 Drawer 内容部分的样式
22
+ *
23
+ * @author zhanghanrui
24
+ * @date 2024-03-29 13:03:26
25
+ * @type {CSSProperties}
26
+ */
27
+ bodyStyle?: CSSProperties;
28
+ /**
29
+ * 对话框外层容器的类名
30
+ *
31
+ * @author zhanghanrui
32
+ * @date 2024-03-29 13:03:57
33
+ * @type {string}
34
+ */
35
+ class?: string;
36
+ /**
37
+ * 是否显示左上角的关闭按钮
38
+ *
39
+ * @default true
40
+ * @author zhanghanrui
41
+ * @date 2024-03-29 13:03:23
42
+ * @type {boolean}
43
+ */
44
+ closable?: boolean;
45
+ /**
46
+ * 自定义关闭图标
47
+ *
48
+ * @author zhanghanrui
49
+ * @date 2024-03-29 13:03:30
50
+ * @type {*}
51
+ */
52
+ closeIcon?: unknown;
53
+ /**
54
+ * 可用于设置 Drawer 包裹内容部分的样式
55
+ *
56
+ * @author zhanghanrui
57
+ * @date 2024-03-29 13:03:39
58
+ * @type {CSSProperties}
59
+ */
60
+ contentWrapperStyle?: CSSProperties;
61
+ /**
62
+ * 关闭时销毁 Drawer 里的子元素
63
+ *
64
+ * @default false
65
+ * @author zhanghanrui
66
+ * @date 2024-03-29 13:03:25
67
+ * @type {boolean}
68
+ */
69
+ destroyOnClose?: boolean;
70
+ /**
71
+ * 用于设置 Drawer 弹出层的样式
72
+ *
73
+ * @author zhanghanrui
74
+ * @date 2024-03-29 13:03:52
75
+ * @type {Object}
76
+ */
77
+ drawerStyle?: object;
78
+ /**
79
+ * 抽屉右上角的操作区域
80
+ *
81
+ * @author zhanghanrui
82
+ * @date 2024-03-29 13:03:16
83
+ * @type {(VNode | slot)}
84
+ */
85
+ extra?: unknown;
86
+ /**
87
+ * 抽屉的页脚
88
+ *
89
+ * @author zhanghanrui
90
+ * @date 2024-03-29 13:03:04
91
+ * @type {(VNode | slot)}
92
+ */
93
+ footer?: unknown;
94
+ /**
95
+ * 抽屉页脚部件的样式
96
+ *
97
+ * @author zhanghanrui
98
+ * @date 2024-03-29 13:03:23
99
+ * @type {CSSProperties}
100
+ */
101
+ footerStyle?: CSSProperties;
102
+ /**
103
+ * 预渲染 Drawer 内元素
104
+ *
105
+ * @default false
106
+ * @author zhanghanrui
107
+ * @date 2024-03-29 13:03:10
108
+ * @type {boolean}
109
+ */
110
+ forceRender?: boolean;
111
+ /**
112
+ * 指定 Drawer 挂载的 HTML 节点
113
+ *
114
+ * @author zhanghanrui
115
+ * @date 2024-03-29 13:03:49
116
+ */
117
+ getContainer?: HTMLElement;
118
+ /**
119
+ * 用于设置 Drawer 头部的样式
120
+ *
121
+ * @author zhanghanrui
122
+ * @date 2024-03-29 13:03:25
123
+ * @type {CSSProperties}
124
+ */
125
+ headerStyle?: CSSProperties;
126
+ /**
127
+ * 高度, 在 placement 为 top 或 bottom 时使用
128
+ *
129
+ * @author zhanghanrui
130
+ * @date 2024-03-29 13:03:40
131
+ * @type {(string | number)}
132
+ */
133
+ height?: string | number;
134
+ /**
135
+ * 是否支持键盘 esc 关闭
136
+ *
137
+ * @default true
138
+ * @author zhanghanrui
139
+ * @date 2024-03-29 13:03:54
140
+ * @type {boolean}
141
+ */
142
+ keyboard?: boolean;
143
+ /**
144
+ * 是否展示遮罩
145
+ *
146
+ * @default true
147
+ * @author zhanghanrui
148
+ * @date 2024-03-29 13:03:17
149
+ * @type {boolean}
150
+ */
151
+ mask?: boolean;
152
+ /**
153
+ * 点击蒙层是否允许关闭
154
+ *
155
+ * @default true
156
+ * @author zhanghanrui
157
+ * @date 2024-03-29 13:03:34
158
+ * @type {boolean}
159
+ */
160
+ maskClosable?: boolean;
161
+ /**
162
+ * 遮罩样式
163
+ *
164
+ * @author zhanghanrui
165
+ * @date 2024-03-29 13:03:49
166
+ * @type {CSSProperties}
167
+ */
168
+ maskStyle?: CSSProperties;
169
+ /**
170
+ * 抽屉的方向
171
+ *
172
+ * @default 'right'
173
+ * @author zhanghanrui
174
+ * @date 2024-03-29 13:03:05
175
+ * @type {('top' | 'right' | 'bottom' | 'left')}
176
+ */
177
+ placement?: 'top' | 'right' | 'bottom' | 'left';
178
+ /**
179
+ * 用于设置多层 Drawer 的推动行为
180
+ *
181
+ * @default { distance: 180 }
182
+ * @author zhanghanrui
183
+ * @date 2024-03-29 13:03:27
184
+ * @type {(boolean | { distance: string | number })}
185
+ */
186
+ push?: boolean | {
187
+ distance: string | number;
188
+ };
189
+ /**
190
+ * 预设抽屉宽度(或高度)
191
+ *
192
+ * @default 'default'
193
+ * @author zhanghanrui
194
+ * @date 2024-03-29 13:03:01
195
+ * @type {('default' | 'large')}
196
+ */
197
+ size?: 'default' | 'large';
198
+ /**
199
+ * 可用于设置 Drawer 最外层容器的样式,和 drawerStyle 的区别是作用节点包括 mask
200
+ *
201
+ * @author zhanghanrui
202
+ * @date 2024-03-29 13:03:23
203
+ * @type {CSSProperties}
204
+ */
205
+ style?: CSSProperties;
206
+ /**
207
+ * 抽屉的标题
208
+ *
209
+ * @author zhanghanrui
210
+ * @date 2024-03-29 13:03:32
211
+ * @type {string}
212
+ */
213
+ title?: string;
214
+ /**
215
+ * (v-model) Drawer 是否可见
216
+ *
217
+ * @author zhanghanrui
218
+ * @date 2024-03-29 13:03:41
219
+ * @type {boolean}
220
+ */
221
+ visible?: boolean;
222
+ /**
223
+ * 宽度
224
+ *
225
+ * @default 378
226
+ * @author zhanghanrui
227
+ * @date 2024-03-29 13:03:58
228
+ * @type {(string | number)}
229
+ */
230
+ width?: string | number;
231
+ /**
232
+ * 设置 Drawer 的 z-index
233
+ *
234
+ * @default 1000
235
+ * @author zhanghanrui
236
+ * @date 2024-03-29 13:03:21
237
+ * @type {number}
238
+ */
239
+ zIndex?: number;
240
+ /**
241
+ * 是否为详情模式
242
+ *
243
+ * @author zhanghanrui
244
+ * @date 2024-03-29 13:03:34
245
+ * @type {boolean}
246
+ */
247
+ isDetail?: boolean;
248
+ /**
249
+ * loading 状态
250
+ *
251
+ * @default false
252
+ * @author zhanghanrui
253
+ * @date 2024-03-29 13:03:48
254
+ * @type {boolean}
255
+ */
256
+ loading?: boolean;
257
+ /**
258
+ * loading 文本
259
+ *
260
+ * @author zhanghanrui
261
+ * @date 2024-03-29 13:03:02
262
+ * @type {string}
263
+ */
264
+ loadingText?: string;
265
+ /**
266
+ * isDetail=true 状态下是否显示返回按钮
267
+ *
268
+ * @default true
269
+ * @author zhanghanrui
270
+ * @date 2024-03-29 14:03:03
271
+ * @type {boolean}
272
+ */
273
+ showDetailBack?: boolean;
274
+ /**
275
+ * 自定义关闭函数,返回true关闭,否则不关闭
276
+ *
277
+ * @author zhanghanrui
278
+ * @date 2024-03-29 14:03:42
279
+ */
280
+ closeFunc?: () => Promise<boolean>;
281
+ /**
282
+ * 是否显示底部
283
+ *
284
+ * @author zhanghanrui
285
+ * @date 2024-03-29 14:03:55
286
+ * @type {boolean}
287
+ */
288
+ showFooter?: boolean;
289
+ /**
290
+ * 底部区域高度
291
+ *
292
+ * @default 60
293
+ * @author zhanghanrui
294
+ * @date 2024-03-29 14:03:22
295
+ * @type {number}
296
+ */
297
+ footerHeight?: number;
298
+ }
@@ -58,8 +58,9 @@ export interface IModal {
58
58
  * @author zhanghanrui
59
59
  * @date 2024-03-29 11:03:03
60
60
  * @param {(() => Promise<IModalData | null>)} ok
61
+ * @param {(() => Promise<boolean>)} [cancel]
61
62
  */
62
- callback(ok: () => Promise<IModalData | null>): void;
63
+ callback(ok: () => Promise<IModalData | null>, cancel?: () => Promise<boolean>): void;
63
64
  /**
64
65
  * 取消操作
65
66
  *
@@ -6,7 +6,7 @@
6
6
  * @export
7
7
  * @interface IModalData
8
8
  */
9
- export interface IModalData {
9
+ export interface IModalData<T = IData> {
10
10
  /**
11
11
  * 关闭模态窗时是否操作成功
12
12
  *
@@ -26,9 +26,9 @@ export interface IModalData {
26
26
  *
27
27
  * @author zhanghanrui
28
28
  * @date 2024-03-19 20:03:44
29
- * @type {IData[]}
29
+ * @type {T[]}
30
30
  */
31
- data?: IData[];
31
+ data?: T[];
32
32
  /**
33
33
  * 额外参数
34
34
  *
@@ -1,3 +1,4 @@
1
+ import { VNode } from 'vue';
1
2
  /**
2
3
  * 模态打开参数,此为具体端实现,具体扩充参数由各端定义
3
4
  *
@@ -6,7 +7,7 @@
6
7
  */
7
8
  export interface IModalOptions {
8
9
  [key: string]: any;
9
- title?: string;
10
+ title?: string | VNode;
10
11
  width?: string | number;
11
12
  zIndex?: number;
12
13
  }
@@ -2,6 +2,7 @@ import { ComputePositionConfig } from '@floating-ui/dom';
2
2
  import { IOverlayContainer } from '../i-overlay-container/i-overlay-container';
3
3
  import { IModalOptions } from '../i-modal-options/i-modal-options';
4
4
  import { IModalData } from '../i-modal-data/i-modal-data';
5
+ import { IDrawerOptions } from '../i-drawer-options/i-drawer-options';
5
6
  import { IPopoverOptions } from '../../i-popover-options/i-popover-options';
6
7
  import { IOverlayPopoverContainer } from '../i-overlay-popover-container/i-overlay-popover-container';
7
8
  import { IAppFullScreenContainerOptions } from '../i-app-full-screen-container-options/i-app-full-screen-container-options';
@@ -38,6 +39,14 @@ export interface IOverlayController {
38
39
  * @return {*} {IOverlayContainer}
39
40
  */
40
41
  createModal(component: unknown, props?: IParams, opts?: IModalOptions): IOverlayContainer;
42
+ /**
43
+ * 抽屉打开组件
44
+ */
45
+ drawer<T = IModalData>(component: unknown, props?: IParams, opts?: IDrawerOptions): Promise<T>;
46
+ /**
47
+ * 创建全局抽屉容器
48
+ */
49
+ createDrawer(component: unknown, props?: IParams, opts?: IDrawerOptions): IOverlayContainer;
41
50
  /**
42
51
  * 飘窗打开组件
43
52
  *
@@ -1,3 +1,4 @@
1
+ export type { IDrawerOptions } from './i-drawer-options/i-drawer-options';
1
2
  export type { IAppFullScreenContainerOptions } from './i-app-full-screen-container-options/i-app-full-screen-container-options';
2
3
  export type { IMessageParams, IMessageUtil, } from './i-message-util/i-message-util';
3
4
  export type { IModal } from './i-modal/i-modal';
@@ -1,6 +1,7 @@
1
1
  import { I18n } from 'vue-i18n';
2
2
  import { App } from 'vue';
3
3
  import { I18nConfigResponse } from '@gct-paas/api/platform';
4
+ import { EnvironmentType } from '../modules/env-manager';
4
5
  type localeItem = Pick<I18nConfigResponse, 'id' | 'configured' | 'defaultLanguage' | 'language' | 'languageTag' | 'state'>;
5
6
  type ILocaleMessages = Record<string, string>;
6
7
  type ILocaleDeclarations = Record<string, ILocaleMessages>;
@@ -38,7 +39,7 @@ export declare class LocaleUtil {
38
39
  } | {
39
40
  locale: string;
40
41
  app: string;
41
- env: 'dev' | 'test' | 'prod';
42
+ env: EnvironmentType;
42
43
  branch?: string;
43
44
  }): string;
44
45
  /**
@@ -18,29 +18,13 @@ export declare class EnvironmentManager implements IEnvironmentManager {
18
18
  /**安卓混合开发模式下 */
19
19
  get isAndroid(): boolean;
20
20
  /**
21
- * 是否为应用前端运行时
22
- */
23
- get isAppRun(): boolean;
24
- /**
25
- * 是否为应用前端运行时生产环境包含测试环境
21
+ * 是否为生产环境
26
22
  */
27
23
  get isAppProd(): boolean;
28
- /**
29
- * 是否为应用前端运行时预览环境
30
- */
31
- get isAppPreview(): boolean;
32
- /**
33
- * 是否为dev环境单应用
34
- */
35
- get isDevSingleEnv(): boolean;
36
24
  /**
37
25
  * 是否为测试环境
38
26
  */
39
27
  get isTestEnv(): boolean;
40
- /**
41
- * 是否是单应用模式
42
- */
43
- get isAppSingle(): boolean;
44
28
  /**
45
29
  * 平台地址
46
30
  */
@@ -8,7 +8,9 @@ export declare enum EnvironmentType {
8
8
  /** 测试环境 */
9
9
  TEST = "test",
10
10
  /** 生产环境 */
11
- PROD = "prod"
11
+ PROD = "prod",
12
+ /** 沙箱环境 */
13
+ SANDBOX = "sandbox"
12
14
  }
13
15
  /**
14
16
  * 环境管理器接口
@@ -16,14 +18,8 @@ export declare enum EnvironmentType {
16
18
  export interface IEnvironmentManager {
17
19
  /** 是否为安卓混合模式下运行 */
18
20
  readonly isAndroid: boolean;
19
- /** 是否为应用前端运行时 */
20
- readonly isAppRun: boolean;
21
- /** 是否为应用前端运行时生产环境 */
21
+ /** 是否为生产环境 */
22
22
  readonly isAppProd: boolean;
23
- /** 是否为应用前端运行时预览环境 */
24
- readonly isAppPreview: boolean;
25
- /** 是否为dev环境单应用 */
26
- readonly isDevSingleEnv: boolean;
27
23
  /** 是否为测试环境 */
28
24
  readonly isTestEnv: boolean;
29
25
  /** 平台地址 */
@@ -34,8 +30,6 @@ export interface IEnvironmentManager {
34
30
  readonly testTenantData: Tenant;
35
31
  /** 是否为沙箱环境 */
36
32
  isSandbox: boolean;
37
- /** 是否是单应用模式 */
38
- isAppSingle: boolean;
39
33
  /**
40
34
  * 检测是否为测试环境
41
35
  * @param loadTenant 是否加载租户信息
@@ -9,6 +9,8 @@ var EnvironmentType = /* @__PURE__ */ function(EnvironmentType) {
9
9
  EnvironmentType["TEST"] = "test";
10
10
  /** 生产环境 */
11
11
  EnvironmentType["PROD"] = "prod";
12
+ /** 沙箱环境 */
13
+ EnvironmentType["SANDBOX"] = "sandbox";
12
14
  return EnvironmentType;
13
15
  }({});
14
16
  //#endregion
@@ -1,6 +1,6 @@
1
- import { ENV } from "../../store/session-store.mjs";
2
1
  import { EnvironmentType } from "./env-manager.interface.mjs";
3
- import { APP_PREVIEW_PATH_REG, APP_PROD_PATH_REG, APP_RUN_PATH_REG, DEV_SINGLE_PATH_REG, HOST_REG, IP_REG, SANDBOX_PATH_REG, SINGLE_PATH_REG, TEST_SINGLE_PATH_REG } from "./env-manager.const.mjs";
2
+ import { ENV } from "../../store/session-store.mjs";
3
+ import { HOST_REG, IP_REG } from "./env-manager.const.mjs";
4
4
  //#region src/modules/env-manager/env-manager.ts
5
5
  /**
6
6
  * 环境管理器
@@ -25,40 +25,16 @@ var EnvironmentManager = class {
25
25
  return window.__GCT_ANDROID__ === true;
26
26
  }
27
27
  /**
28
- * 是否为应用前端运行时
29
- */
30
- get isAppRun() {
31
- return APP_RUN_PATH_REG.test(location.pathname);
32
- }
33
- /**
34
- * 是否为应用前端运行时生产环境包含测试环境
28
+ * 是否为生产环境
35
29
  */
36
30
  get isAppProd() {
37
- return APP_PROD_PATH_REG.test(location.pathname);
38
- }
39
- /**
40
- * 是否为应用前端运行时预览环境
41
- */
42
- get isAppPreview() {
43
- return APP_PREVIEW_PATH_REG.test(location.pathname);
44
- }
45
- /**
46
- * 是否为dev环境单应用
47
- */
48
- get isDevSingleEnv() {
49
- return DEV_SINGLE_PATH_REG.test(location.pathname);
31
+ return _gct.store.context.env === EnvironmentType.PROD;
50
32
  }
51
33
  /**
52
34
  * 是否为测试环境
53
35
  */
54
36
  get isTestEnv() {
55
- return TEST_SINGLE_PATH_REG.test(location.pathname) || this._testEnv;
56
- }
57
- /**
58
- * 是否是单应用模式
59
- */
60
- get isAppSingle() {
61
- return SINGLE_PATH_REG.test(location.pathname);
37
+ return this._testEnv || _gct.store.context.env === EnvironmentType.TEST;
62
38
  }
63
39
  /**
64
40
  * 平台地址
@@ -82,7 +58,7 @@ var EnvironmentManager = class {
82
58
  * 是否为沙箱环境
83
59
  */
84
60
  get isSandbox() {
85
- return SANDBOX_PATH_REG.test(location.pathname);
61
+ return _gct.store.context.env === EnvironmentType.SANDBOX;
86
62
  }
87
63
  /**
88
64
  * 检测是否为测试环境
@@ -107,6 +83,7 @@ var EnvironmentManager = class {
107
83
  }
108
84
  }
109
85
  }
86
+ if (this._testEnv) await _gct.store.setContext({ env: EnvironmentType.TEST });
110
87
  }
111
88
  /**
112
89
  * 获取当前环境类型
@@ -114,9 +91,9 @@ var EnvironmentManager = class {
114
91
  */
115
92
  getEnv() {
116
93
  if (ENV.value) return ENV.value;
117
- else if (this.isTestEnv) return EnvironmentType.TEST;
118
- else if (this.isAppProd || this.isAndroid) return EnvironmentType.PROD;
119
- else return EnvironmentType.DEV;
94
+ if (this.isTestEnv) return EnvironmentType.TEST;
95
+ if (_gct.store.context.env) return _gct.store.context.env;
96
+ return EnvironmentType.DEV;
120
97
  }
121
98
  };
122
99
  //#endregion
@@ -0,0 +1,5 @@
1
+ import { EnvironmentType } from './env-manager.interface';
2
+ /**
3
+ * 校验并规范化环境类型
4
+ */
5
+ export declare function normalizeEnv(env: unknown): EnvironmentType | undefined;
@@ -0,0 +1,11 @@
1
+ import { EnvironmentType } from "./env-manager.interface.mjs";
2
+ //#region src/modules/env-manager/env-manager.util.ts
3
+ var ENV_VALUES = new Set(Object.values(EnvironmentType));
4
+ /**
5
+ * 校验并规范化环境类型
6
+ */
7
+ function normalizeEnv(env) {
8
+ if (typeof env === "string" && ENV_VALUES.has(env)) return env;
9
+ }
10
+ //#endregion
11
+ export { normalizeEnv };
@@ -1,3 +1,4 @@
1
1
  export * from './env-manager.interface';
2
2
  export * from './env-manager.const';
3
+ export * from './env-manager.util';
3
4
  export { EnvironmentManager } from './env-manager';
@@ -1,3 +1,4 @@
1
1
  import "./env-manager.interface.mjs";
2
+ import "./env-manager.util.mjs";
2
3
  import "./env-manager.const.mjs";
3
4
  import "./env-manager.mjs";
@@ -21,5 +21,7 @@ export declare enum LoginTypeEnum {
21
21
  /** 飞书 */
22
22
  FEISHU = "FEISHU",
23
23
  /** 企业微信 */
24
- QIYEWEIXIN = "QIYEWEIXIN"
24
+ QIYEWEIXIN = "QIYEWEIXIN",
25
+ /** 微软 */
26
+ MICROSOFT = "MICROSOFT"
25
27
  }
@@ -24,6 +24,8 @@ var LoginTypeEnum = /* @__PURE__ */ function(LoginTypeEnum) {
24
24
  LoginTypeEnum["FEISHU"] = "FEISHU";
25
25
  /** 企业微信 */
26
26
  LoginTypeEnum["QIYEWEIXIN"] = "QIYEWEIXIN";
27
+ /** 微软 */
28
+ LoginTypeEnum["MICROSOFT"] = "MICROSOFT";
27
29
  return LoginTypeEnum;
28
30
  }({});
29
31
  //#endregion
@@ -4,6 +4,7 @@ import { GlobalPiniaState } from "../state/global-pinia-state/global-pinia-state
4
4
  import "../state/index.mjs";
5
5
  import { parseMatrixParams } from "../utils/tools/tools.mjs";
6
6
  import "../utils/index.mjs";
7
+ import { normalizeEnv } from "../modules/env-manager/env-manager.util.mjs";
7
8
  import { defineStore } from "pinia";
8
9
  //#region src/store/global-store.ts
9
10
  var useGlobalStore = defineStore("global-store", {
@@ -32,8 +33,9 @@ var useGlobalStore = defineStore("global-store", {
32
33
  const paramStr = location.pathname.split("/")[2];
33
34
  if (paramStr) {
34
35
  const params = parseMatrixParams(paramStr);
35
- if (params) this.context = params;
36
+ if (params && Object.keys(params).length) Object.assign(this.context, params);
36
37
  }
38
+ this.context.env = normalizeEnv(this.context.env);
37
39
  },
38
40
  async loadAppInfo() {
39
41
  const res = await _api.apaas.designerCommon.getGetApp();
@@ -20,6 +20,18 @@ function interceptors(axios) {
20
20
  });
21
21
  return config;
22
22
  });
23
+ axios.interceptors.response.use((response) => {
24
+ if (response.data.code === 200) return response;
25
+ else {
26
+ const { errorMessageMode } = response.config || {};
27
+ const { subMessage, message, subCode } = response.data;
28
+ if (errorMessageMode === "none" || subCode === "sys.plat.api.pass.failure.over.max_times") console.error(response.data);
29
+ else if (subMessage || message) _gct.message.error(subMessage || message);
30
+ }
31
+ return response;
32
+ }, (err) => {
33
+ return Promise.reject(err);
34
+ });
23
35
  }
24
36
  //#endregion
25
37
  export { interceptors };
@@ -25,7 +25,7 @@ export declare class Modal implements IModal {
25
25
  shouldDismiss: AsyncSeriesHook<[], {
26
26
  allowClose?: boolean;
27
27
  }>;
28
- beforeDismiss: AsyncSeriesHook<[], IModalData>;
28
+ beforeDismiss: AsyncSeriesHook<[], IModalData<IData>>;
29
29
  };
30
30
  ok?: () => Promise<IModalData | null>;
31
31
  setOptions?: (options: object) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gct-paas/core",
3
- "version": "0.1.6-dev.17",
3
+ "version": "0.1.6-dev.18",
4
4
  "type": "module",
5
5
  "description": "paas 平台核心包",
6
6
  "loader": "dist/index.esm.min.js",