@gct-paas/core 0.1.5-dev.3 → 0.1.5-dev.5

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 (38) hide show
  1. package/dist/index.esm.min.js +1 -1
  2. package/es/enums/page-designer/widget.d.ts +2 -2
  3. package/es/global/gct/gct.d.ts +108 -107
  4. package/es/hooks/index.d.ts +1 -0
  5. package/es/hooks/index.mjs +1 -0
  6. package/es/hooks/useFile.d.ts +4 -0
  7. package/es/hooks/useFile.mjs +22 -0
  8. package/es/index.mjs +3 -1
  9. package/es/interface/i-kit-plugin-module/i-kit-plugin-module.d.ts +23 -0
  10. package/es/interface/i-pinia-action/i-global-actions.d.ts +3 -0
  11. package/es/interface/index.d.ts +1 -1
  12. package/es/locale/index.d.ts +3 -1
  13. package/es/locale/index.mjs +18 -3
  14. package/es/modules/platform-config/store.d.ts +106 -106
  15. package/es/modules/platform-config/useSecuritySetting.d.ts +1 -1
  16. package/es/modules/user-stores/store/tenant.store.d.ts +6 -8
  17. package/es/modules/user-stores/store/tenant.store.mjs +12 -14
  18. package/es/modules/user-stores/store/user.store.d.ts +7 -2
  19. package/es/modules/user-stores/store/user.store.mjs +15 -4
  20. package/es/modules/user-stores/types/tenant.d.ts +7 -1
  21. package/es/router/index.mjs +2 -2
  22. package/es/setup-app.mjs +4 -2
  23. package/es/store/global-store.mjs +3 -0
  24. package/es/store/index.d.ts +1 -0
  25. package/es/store/index.mjs +1 -0
  26. package/es/store/session-store.d.ts +7 -0
  27. package/es/store/session-store.mjs +7 -0
  28. package/es/store/storage-store.d.ts +2 -0
  29. package/es/store/storage-store.mjs +3 -2
  30. package/es/types/index.d.ts +0 -1
  31. package/es/utils/file/download.d.ts +1 -1
  32. package/es/utils/file/parser.d.ts +1 -1
  33. package/es/utils/kit-pkg-util/kit-pkg-util.d.ts +34 -13
  34. package/es/utils/kit-pkg-util/kit-pkg-util.mjs +51 -40
  35. package/es/utils/plugin-pkg-util/plugin-pkg-util.d.ts +2 -2
  36. package/es/utils/tools/tools.d.ts +1 -1
  37. package/package.json +4 -4
  38. package/es/interface/i-kit-info/i-kit-info.d.ts +0 -20
@@ -3,39 +3,22 @@ import { SysConfigResponse } from '@gct-paas/api/platform';
3
3
  * 平台配置 Store
4
4
  */
5
5
  export declare const usePlatformConfigStore: import('pinia').StoreDefinition<"platform-config", Pick<{
6
- projectSetting: {};
7
- setProjectConfig: (config: {}) => void;
6
+ basicSetting: import('@gct-paas/api/platform').PlatformBaseConfig;
7
+ setBasicSetting: (data: SysConfigResponse, transfer?: boolean) => void;
8
+ postBasicSetting: () => Promise<string>;
8
9
  deploySetting: {
9
10
  deployMode: import('./enums').DeployModeEnum;
10
11
  };
11
12
  setDeploySetting: (data: SysConfigResponse) => void;
12
13
  isIndependentApp: import('vue').ComputedRef<boolean>;
13
- watermarkSetting: {
14
- openWatermark: boolean;
15
- watermarkContent: string;
16
- fontSize: number;
17
- color: string;
18
- verticalAlign: string;
19
- textAlign: string;
20
- text: string;
21
- transparent: number;
22
- width: number;
23
- height: number;
24
- };
25
- postWatermarkSetting: () => Promise<void>;
26
- setWatermarkSetting: (data: SysConfigResponse) => void;
27
- themeSetting: import('./interfaces').IThemeSetting;
28
- setThemeSetting: (data: SysConfigResponse) => void;
29
- postThemeSetting: () => Promise<void>;
30
- menuCollapsed: import('vue').Ref<boolean, boolean>;
31
- toggleMenuCollapsed: () => void;
32
- menuCollapsedWidth: number;
33
- menuWidthRange: number[];
34
- themeColors: string[];
35
- securitySetting: import('@gct-paas/api/platform').SecurityConfig;
36
- postSecuritySetting: () => Promise<void>;
37
- setSecuritySetting: (data: SysConfigResponse) => void;
38
- getSignWay: () => "LOGIN" | "SIGN" | "DOMAIN";
14
+ loginSetting: import('@gct-paas/api/platform').AuthConfig;
15
+ postLoginSetting: () => Promise<void>;
16
+ setLoginSetting: (config: SysConfigResponse | undefined) => void;
17
+ loginModeAuthTypes: import('vue').Ref<string[], string[]>;
18
+ openIDOAuthAuthTypes: import('vue').Ref<string[], string[]>;
19
+ sysLoginSort: import('vue').Ref<IObject[], IObject[]>;
20
+ openIDOAuthAuthSort: import('vue').Ref<IObject[], IObject[]>;
21
+ loginModeConfig: Map<string, IObject>;
39
22
  orgSetting: import('@gct-paas/api/platform').OrgConfig;
40
23
  setOrgSetting: (data: SysConfigResponse) => void;
41
24
  postOrgSetting: () => Promise<void>;
@@ -62,27 +45,18 @@ export declare const usePlatformConfigStore: import('pinia').StoreDefinition<"pl
62
45
  label: string;
63
46
  value: string;
64
47
  }[]>;
65
- loginSetting: import('@gct-paas/api/platform').AuthConfig;
66
- postLoginSetting: () => Promise<void>;
67
- setLoginSetting: (config: SysConfigResponse | undefined) => void;
68
- loginModeAuthTypes: import('vue').Ref<string[], string[]>;
69
- openIDOAuthAuthTypes: import('vue').Ref<string[], string[]>;
70
- sysLoginSort: import('vue').Ref<IObject[], IObject[]>;
71
- openIDOAuthAuthSort: import('vue').Ref<IObject[], IObject[]>;
72
- loginModeConfig: Map<string, IObject>;
73
- basicSetting: import('@gct-paas/api/platform').PlatformBaseConfig;
74
- setBasicSetting: (data: SysConfigResponse, transfer?: boolean) => void;
75
- postBasicSetting: () => Promise<string>;
76
- init: () => Promise<void>;
77
- renderInit: () => Promise<void>;
78
- }, "projectSetting" | "deploySetting" | "watermarkSetting" | "themeSetting" | "menuCollapsed" | "menuCollapsedWidth" | "menuWidthRange" | "themeColors" | "securitySetting" | "orgSetting" | "relationFields" | "relationFiledsCopy" | "loginSetting" | "loginModeAuthTypes" | "openIDOAuthAuthTypes" | "sysLoginSort" | "openIDOAuthAuthSort" | "loginModeConfig" | "basicSetting">, Pick<{
79
- projectSetting: {};
80
- setProjectConfig: (config: {}) => void;
81
- deploySetting: {
82
- deployMode: import('./enums').DeployModeEnum;
83
- };
84
- setDeploySetting: (data: SysConfigResponse) => void;
85
- isIndependentApp: import('vue').ComputedRef<boolean>;
48
+ securitySetting: import('@gct-paas/api/platform').SecurityConfig;
49
+ postSecuritySetting: () => Promise<void>;
50
+ setSecuritySetting: (data: SysConfigResponse) => void;
51
+ getSignWay: () => "DOMAIN" | "LOGIN" | "SIGN";
52
+ themeSetting: import('./interfaces').IThemeSetting;
53
+ setThemeSetting: (data: SysConfigResponse) => void;
54
+ postThemeSetting: () => Promise<void>;
55
+ menuCollapsed: import('vue').Ref<boolean, boolean>;
56
+ toggleMenuCollapsed: () => void;
57
+ menuCollapsedWidth: number;
58
+ menuWidthRange: number[];
59
+ themeColors: string[];
86
60
  watermarkSetting: {
87
61
  openWatermark: boolean;
88
62
  watermarkContent: string;
@@ -97,18 +71,27 @@ export declare const usePlatformConfigStore: import('pinia').StoreDefinition<"pl
97
71
  };
98
72
  postWatermarkSetting: () => Promise<void>;
99
73
  setWatermarkSetting: (data: SysConfigResponse) => void;
100
- themeSetting: import('./interfaces').IThemeSetting;
101
- setThemeSetting: (data: SysConfigResponse) => void;
102
- postThemeSetting: () => Promise<void>;
103
- menuCollapsed: import('vue').Ref<boolean, boolean>;
104
- toggleMenuCollapsed: () => void;
105
- menuCollapsedWidth: number;
106
- menuWidthRange: number[];
107
- themeColors: string[];
108
- securitySetting: import('@gct-paas/api/platform').SecurityConfig;
109
- postSecuritySetting: () => Promise<void>;
110
- setSecuritySetting: (data: SysConfigResponse) => void;
111
- getSignWay: () => "LOGIN" | "SIGN" | "DOMAIN";
74
+ projectSetting: {};
75
+ setProjectConfig: (config: {}) => void;
76
+ init: () => Promise<void>;
77
+ renderInit: () => Promise<void>;
78
+ }, "basicSetting" | "deploySetting" | "loginModeAuthTypes" | "loginModeConfig" | "loginSetting" | "menuCollapsed" | "menuCollapsedWidth" | "menuWidthRange" | "openIDOAuthAuthSort" | "openIDOAuthAuthTypes" | "orgSetting" | "projectSetting" | "relationFields" | "relationFiledsCopy" | "securitySetting" | "sysLoginSort" | "themeColors" | "themeSetting" | "watermarkSetting">, Pick<{
79
+ basicSetting: import('@gct-paas/api/platform').PlatformBaseConfig;
80
+ setBasicSetting: (data: SysConfigResponse, transfer?: boolean) => void;
81
+ postBasicSetting: () => Promise<string>;
82
+ deploySetting: {
83
+ deployMode: import('./enums').DeployModeEnum;
84
+ };
85
+ setDeploySetting: (data: SysConfigResponse) => void;
86
+ isIndependentApp: import('vue').ComputedRef<boolean>;
87
+ loginSetting: import('@gct-paas/api/platform').AuthConfig;
88
+ postLoginSetting: () => Promise<void>;
89
+ setLoginSetting: (config: SysConfigResponse | undefined) => void;
90
+ loginModeAuthTypes: import('vue').Ref<string[], string[]>;
91
+ openIDOAuthAuthTypes: import('vue').Ref<string[], string[]>;
92
+ sysLoginSort: import('vue').Ref<IObject[], IObject[]>;
93
+ openIDOAuthAuthSort: import('vue').Ref<IObject[], IObject[]>;
94
+ loginModeConfig: Map<string, IObject>;
112
95
  orgSetting: import('@gct-paas/api/platform').OrgConfig;
113
96
  setOrgSetting: (data: SysConfigResponse) => void;
114
97
  postOrgSetting: () => Promise<void>;
@@ -135,27 +118,18 @@ export declare const usePlatformConfigStore: import('pinia').StoreDefinition<"pl
135
118
  label: string;
136
119
  value: string;
137
120
  }[]>;
138
- loginSetting: import('@gct-paas/api/platform').AuthConfig;
139
- postLoginSetting: () => Promise<void>;
140
- setLoginSetting: (config: SysConfigResponse | undefined) => void;
141
- loginModeAuthTypes: import('vue').Ref<string[], string[]>;
142
- openIDOAuthAuthTypes: import('vue').Ref<string[], string[]>;
143
- sysLoginSort: import('vue').Ref<IObject[], IObject[]>;
144
- openIDOAuthAuthSort: import('vue').Ref<IObject[], IObject[]>;
145
- loginModeConfig: Map<string, IObject>;
146
- basicSetting: import('@gct-paas/api/platform').PlatformBaseConfig;
147
- setBasicSetting: (data: SysConfigResponse, transfer?: boolean) => void;
148
- postBasicSetting: () => Promise<string>;
149
- init: () => Promise<void>;
150
- renderInit: () => Promise<void>;
151
- }, "isIndependentApp">, Pick<{
152
- projectSetting: {};
153
- setProjectConfig: (config: {}) => void;
154
- deploySetting: {
155
- deployMode: import('./enums').DeployModeEnum;
156
- };
157
- setDeploySetting: (data: SysConfigResponse) => void;
158
- isIndependentApp: import('vue').ComputedRef<boolean>;
121
+ securitySetting: import('@gct-paas/api/platform').SecurityConfig;
122
+ postSecuritySetting: () => Promise<void>;
123
+ setSecuritySetting: (data: SysConfigResponse) => void;
124
+ getSignWay: () => "DOMAIN" | "LOGIN" | "SIGN";
125
+ themeSetting: import('./interfaces').IThemeSetting;
126
+ setThemeSetting: (data: SysConfigResponse) => void;
127
+ postThemeSetting: () => Promise<void>;
128
+ menuCollapsed: import('vue').Ref<boolean, boolean>;
129
+ toggleMenuCollapsed: () => void;
130
+ menuCollapsedWidth: number;
131
+ menuWidthRange: number[];
132
+ themeColors: string[];
159
133
  watermarkSetting: {
160
134
  openWatermark: boolean;
161
135
  watermarkContent: string;
@@ -170,18 +144,27 @@ export declare const usePlatformConfigStore: import('pinia').StoreDefinition<"pl
170
144
  };
171
145
  postWatermarkSetting: () => Promise<void>;
172
146
  setWatermarkSetting: (data: SysConfigResponse) => void;
173
- themeSetting: import('./interfaces').IThemeSetting;
174
- setThemeSetting: (data: SysConfigResponse) => void;
175
- postThemeSetting: () => Promise<void>;
176
- menuCollapsed: import('vue').Ref<boolean, boolean>;
177
- toggleMenuCollapsed: () => void;
178
- menuCollapsedWidth: number;
179
- menuWidthRange: number[];
180
- themeColors: string[];
181
- securitySetting: import('@gct-paas/api/platform').SecurityConfig;
182
- postSecuritySetting: () => Promise<void>;
183
- setSecuritySetting: (data: SysConfigResponse) => void;
184
- getSignWay: () => "LOGIN" | "SIGN" | "DOMAIN";
147
+ projectSetting: {};
148
+ setProjectConfig: (config: {}) => void;
149
+ init: () => Promise<void>;
150
+ renderInit: () => Promise<void>;
151
+ }, "isIndependentApp">, Pick<{
152
+ basicSetting: import('@gct-paas/api/platform').PlatformBaseConfig;
153
+ setBasicSetting: (data: SysConfigResponse, transfer?: boolean) => void;
154
+ postBasicSetting: () => Promise<string>;
155
+ deploySetting: {
156
+ deployMode: import('./enums').DeployModeEnum;
157
+ };
158
+ setDeploySetting: (data: SysConfigResponse) => void;
159
+ isIndependentApp: import('vue').ComputedRef<boolean>;
160
+ loginSetting: import('@gct-paas/api/platform').AuthConfig;
161
+ postLoginSetting: () => Promise<void>;
162
+ setLoginSetting: (config: SysConfigResponse | undefined) => void;
163
+ loginModeAuthTypes: import('vue').Ref<string[], string[]>;
164
+ openIDOAuthAuthTypes: import('vue').Ref<string[], string[]>;
165
+ sysLoginSort: import('vue').Ref<IObject[], IObject[]>;
166
+ openIDOAuthAuthSort: import('vue').Ref<IObject[], IObject[]>;
167
+ loginModeConfig: Map<string, IObject>;
185
168
  orgSetting: import('@gct-paas/api/platform').OrgConfig;
186
169
  setOrgSetting: (data: SysConfigResponse) => void;
187
170
  postOrgSetting: () => Promise<void>;
@@ -208,18 +191,35 @@ export declare const usePlatformConfigStore: import('pinia').StoreDefinition<"pl
208
191
  label: string;
209
192
  value: string;
210
193
  }[]>;
211
- loginSetting: import('@gct-paas/api/platform').AuthConfig;
212
- postLoginSetting: () => Promise<void>;
213
- setLoginSetting: (config: SysConfigResponse | undefined) => void;
214
- loginModeAuthTypes: import('vue').Ref<string[], string[]>;
215
- openIDOAuthAuthTypes: import('vue').Ref<string[], string[]>;
216
- sysLoginSort: import('vue').Ref<IObject[], IObject[]>;
217
- openIDOAuthAuthSort: import('vue').Ref<IObject[], IObject[]>;
218
- loginModeConfig: Map<string, IObject>;
219
- basicSetting: import('@gct-paas/api/platform').PlatformBaseConfig;
220
- setBasicSetting: (data: SysConfigResponse, transfer?: boolean) => void;
221
- postBasicSetting: () => Promise<string>;
194
+ securitySetting: import('@gct-paas/api/platform').SecurityConfig;
195
+ postSecuritySetting: () => Promise<void>;
196
+ setSecuritySetting: (data: SysConfigResponse) => void;
197
+ getSignWay: () => "DOMAIN" | "LOGIN" | "SIGN";
198
+ themeSetting: import('./interfaces').IThemeSetting;
199
+ setThemeSetting: (data: SysConfigResponse) => void;
200
+ postThemeSetting: () => Promise<void>;
201
+ menuCollapsed: import('vue').Ref<boolean, boolean>;
202
+ toggleMenuCollapsed: () => void;
203
+ menuCollapsedWidth: number;
204
+ menuWidthRange: number[];
205
+ themeColors: string[];
206
+ watermarkSetting: {
207
+ openWatermark: boolean;
208
+ watermarkContent: string;
209
+ fontSize: number;
210
+ color: string;
211
+ verticalAlign: string;
212
+ textAlign: string;
213
+ text: string;
214
+ transparent: number;
215
+ width: number;
216
+ height: number;
217
+ };
218
+ postWatermarkSetting: () => Promise<void>;
219
+ setWatermarkSetting: (data: SysConfigResponse) => void;
220
+ projectSetting: {};
221
+ setProjectConfig: (config: {}) => void;
222
222
  init: () => Promise<void>;
223
223
  renderInit: () => Promise<void>;
224
- }, "setProjectConfig" | "setDeploySetting" | "postWatermarkSetting" | "setWatermarkSetting" | "setThemeSetting" | "postThemeSetting" | "toggleMenuCollapsed" | "postSecuritySetting" | "setSecuritySetting" | "getSignWay" | "setOrgSetting" | "postOrgSetting" | "postLoginSetting" | "setLoginSetting" | "setBasicSetting" | "postBasicSetting" | "init" | "renderInit">>;
224
+ }, "getSignWay" | "init" | "postBasicSetting" | "postLoginSetting" | "postOrgSetting" | "postSecuritySetting" | "postThemeSetting" | "postWatermarkSetting" | "renderInit" | "setBasicSetting" | "setDeploySetting" | "setLoginSetting" | "setOrgSetting" | "setProjectConfig" | "setSecuritySetting" | "setThemeSetting" | "setWatermarkSetting" | "toggleMenuCollapsed">>;
225
225
  export type IPlatformConfigStore = ReturnType<typeof usePlatformConfigStore>;
@@ -8,5 +8,5 @@ export declare function useSecuritySetting(isPlatform?: boolean): {
8
8
  securitySetting: SecurityConfig;
9
9
  postSecuritySetting: () => Promise<void>;
10
10
  setSecuritySetting: (data: SysConfigResponse) => void;
11
- getSignWay: () => "LOGIN" | "SIGN" | "DOMAIN";
11
+ getSignWay: () => "DOMAIN" | "LOGIN" | "SIGN";
12
12
  };
@@ -1,9 +1,7 @@
1
1
  import { UserOfTenantDTO } from '@gct-paas/api/platform';
2
- export declare const useTenantStore: import('pinia').StoreDefinition<"tenant", {
3
- tenantId: string;
4
- tenantUserInfo: {};
5
- tenantUserPermissions: {};
6
- }, {}, {
7
- setTenant(tenantId: string): void;
8
- getTenantUserInfoAction(): Promise<UserOfTenantDTO | undefined>;
9
- }>;
2
+ import { tenantState } from '../types/tenant';
3
+ export declare const useTenantStore: import('pinia').StoreDefinition<"tenant", tenantState, {
4
+ getTenantUserInfoAction(state: {
5
+ tenantUserInfo: Record<string, UserOfTenantDTO>;
6
+ } & import('pinia').PiniaCustomStateProperties<tenantState>): () => Promise<UserOfTenantDTO>;
7
+ }, {}>;
@@ -1,22 +1,20 @@
1
+ import { getTenant } from "../../../utils/tools/tools.mjs";
2
+ import "../../../utils/index.mjs";
1
3
  import { defineStore } from "pinia";
2
4
  //#region src/modules/user-stores/store/tenant.store.ts
3
5
  var useTenantStore = defineStore("tenant", {
4
- state: () => ({
5
- tenantId: "",
6
- tenantUserInfo: {},
7
- tenantUserPermissions: {}
8
- }),
9
- actions: {
10
- setTenant(tenantId) {
11
- this.tenantId = tenantId;
12
- },
13
- async getTenantUserInfoAction() {
14
- if (!this.tenantId) return;
6
+ state: () => ({ tenantUserInfo: {} }),
7
+ getters: { getTenantUserInfoAction(state) {
8
+ return async () => {
9
+ const tenantId = getTenant();
10
+ if (!tenantId) return Promise.reject(null);
11
+ if (state.tenantUserInfo[tenantId]) return state.tenantUserInfo[tenantId];
15
12
  const info = await _api.platform.tenant.getUserInfo();
16
- this.tenantUserInfo = info;
13
+ state.tenantUserInfo[tenantId] = info;
17
14
  return info;
18
- }
19
- }
15
+ };
16
+ } },
17
+ actions: {}
20
18
  });
21
19
  //#endregion
22
20
  export { useTenantStore };
@@ -290,13 +290,18 @@ export declare const useUserStore: import('pinia').StoreDefinition<"user", UserS
290
290
  }, {
291
291
  login(config: LoginParams, { hasError }?: {
292
292
  hasError: any;
293
- }): Promise<null | undefined>;
293
+ }): Promise<UserLoginResp>;
294
294
  getUserInfoAction(Token?: string): Promise<UserLoginResp | null>;
295
295
  /**单应用登录 */
296
296
  afterLoginSingleApp(): Promise<void>;
297
297
  /**登录后逻辑 */
298
298
  afterLoginAction(): Promise<null | undefined>;
299
- logout(): Promise<void>;
299
+ /**退出登录 接口*/
300
+ submitLoginOut(): Promise<void>;
301
+ /**
302
+ * 清空对应信息
303
+ */
304
+ appLoginOut(): Promise<void>;
300
305
  setUserInfo(info: IObject): Promise<void>;
301
306
  updateUserInfo(data: IObject): Promise<void>;
302
307
  }>;
@@ -1,6 +1,9 @@
1
1
  import { getTenant, getToken, setToken } from "../../../utils/tools/tools.mjs";
2
+ import { sha256 } from "../../../utils/uuid/uuid.mjs";
2
3
  import { getDeviceFingerprint, getPageIdentification } from "../../../utils/deviceFingerprint.mjs";
3
4
  import "../../../utils/index.mjs";
5
+ import { globalRefStorage } from "../../../store/storage-store.mjs";
6
+ import "../../../store/index.mjs";
4
7
  import { defineStore } from "pinia";
5
8
  //#region src/modules/user-stores/store/user.store.ts
6
9
  var useUserStore = defineStore("user", {
@@ -26,9 +29,9 @@ var useUserStore = defineStore("user", {
26
29
  async login(config, { hasError } = {}) {
27
30
  try {
28
31
  const { token, signWay } = await loginApi(config, hasError);
29
- sessionStorage.setItem("signWay", signWay);
32
+ globalRefStorage.value.signWay = signWay || "";
30
33
  setToken(token);
31
- return this.afterLoginAction();
34
+ return this.getUserInfoAction(token);
32
35
  } catch (error) {
33
36
  return Promise.reject(error);
34
37
  }
@@ -47,8 +50,13 @@ var useUserStore = defineStore("user", {
47
50
  async afterLoginAction() {
48
51
  if (!getToken) return null;
49
52
  },
50
- async logout() {
53
+ async submitLoginOut() {
51
54
  await doLogout();
55
+ this.appLoginOut();
56
+ },
57
+ async appLoginOut() {
58
+ setToken();
59
+ this.setUserInfo({});
52
60
  },
53
61
  async setUserInfo(info) {
54
62
  this.userInfo = {
@@ -75,7 +83,10 @@ var useUserStore = defineStore("user", {
75
83
  */
76
84
  async function loginApi(params, { hasError = true } = {}) {
77
85
  const fingerprint = await getDeviceFingerprint();
78
- return await _api.platform.login.postSign(params, { headers: {
86
+ return await _api.platform.login.postSign({
87
+ ...params,
88
+ password: sha256(params.password || "")
89
+ }, { headers: {
79
90
  browser: fingerprint,
80
91
  "Auth-Code": params.authCode,
81
92
  hasError
@@ -1 +1,7 @@
1
- export {};
1
+ import { UserOfTenantDTO } from '@gct-paas/api/platform';
2
+ /**
3
+ * 租户信息
4
+ */
5
+ export interface tenantState {
6
+ tenantUserInfo: Record<string, UserOfTenantDTO>;
7
+ }
@@ -16,9 +16,9 @@ var RouterUtil = class {
16
16
  * @description 将单个或多个路由记录添加到路由器中
17
17
  */
18
18
  async add(route) {
19
- if (Array.isArray(route)) route.forEach((r) => this.add(r));
19
+ if (Array.isArray(route)) route.forEach((r) => this.router.addRoute(r));
20
20
  else this.router.addRoute(route);
21
- await this.router.replace(this.router.currentRoute.value.fullPath);
21
+ if (!this.router.hasRoute(this.router.currentRoute.value.name)) await this.router.replace(this.router.currentRoute.value.fullPath);
22
22
  }
23
23
  /**刷新当前路由 */
24
24
  async redo() {
package/es/setup-app.mjs CHANGED
@@ -16,9 +16,11 @@ import { HttpUtil } from "@gct-paas/api";
16
16
  async function setupApp(_app) {
17
17
  HttpUtil.use(interceptors);
18
18
  await _gct.init();
19
- const token = getToken();
20
- if (token) await useUserStore().getUserInfoAction(token);
21
19
  await usePlatformConfigStore().init();
20
+ const token = getToken();
21
+ if (token) try {
22
+ await useUserStore().getUserInfoAction(token);
23
+ } catch {}
22
24
  }
23
25
  //#endregion
24
26
  export { setupApp };
@@ -22,6 +22,9 @@ var useGlobalStore = defineStore("global-store", {
22
22
  }
23
23
  },
24
24
  actions: {
25
+ async setContext(ctx = {}) {
26
+ Object.assign(this.context, ctx);
27
+ },
25
28
  async init() {
26
29
  const paramStr = location.pathname.split("/")[2];
27
30
  if (paramStr) {
@@ -1,6 +1,7 @@
1
1
  import { IGlobalStore } from './global-store';
2
2
  import { IPlatformConfigStore } from '../modules/platform-config';
3
3
  export { globalRefStorage } from './storage-store';
4
+ export { globalRefSession } from './session-store';
4
5
  /**
5
6
  * 全局的状态管理工具类
6
7
  *
@@ -2,6 +2,7 @@ import { useGlobalStore } from "./global-store.mjs";
2
2
  import { usePlatformConfigStore } from "../modules/platform-config/store.mjs";
3
3
  import "../modules/platform-config/index.mjs";
4
4
  import "./storage-store.mjs";
5
+ import "./session-store.mjs";
5
6
  import { createPinia, setActivePinia } from "pinia";
6
7
  //#region src/store/index.ts
7
8
  /**
@@ -0,0 +1,7 @@
1
+ /**
2
+ * 全局双向绑定持续化缓存Map
3
+ */
4
+ export declare const globalRefSession: import('@vueuse/core').RemovableRef<{
5
+ /**登录登出标识 */
6
+ currentPlatOrAppId: string;
7
+ }>;
@@ -0,0 +1,7 @@
1
+ import { useSessionStorage } from "@vueuse/core";
2
+ /**
3
+ * 全局双向绑定持续化缓存Map
4
+ */
5
+ var globalRefSession = useSessionStorage("GCT_GLOBAL_SESSION:PAAS", { currentPlatOrAppId: "" });
6
+ //#endregion
7
+ export { globalRefSession };
@@ -6,4 +6,6 @@ export declare const globalRefStorage: import('@vueuse/core').RemovableRef<{
6
6
  timezone: string;
7
7
  /**语言标识 */
8
8
  lang: string;
9
+ /**登录登出专用标识 */
10
+ signWay: string;
9
11
  }>;
@@ -2,9 +2,10 @@ import { useStorage } from "@vueuse/core";
2
2
  /**
3
3
  * 全局双向绑定持续化缓存Map
4
4
  */
5
- var globalRefStorage = useStorage("GCT_GLOBAL:PAAS", {
5
+ var globalRefStorage = useStorage("GCT_GLOBAL_STORAGE:PAAS", {
6
6
  timezone: "UTC+08:00",
7
- lang: ""
7
+ lang: "",
8
+ signWay: ""
8
9
  });
9
10
  //#endregion
10
11
  export { globalRefStorage };
@@ -64,7 +64,6 @@ declare global {
64
64
  }
65
65
 
66
66
  interface ImportMetaEnv {
67
- VITE_GLOBAL_HOST: string;
68
67
  pkg: {
69
68
  name: string;
70
69
  version: string;
@@ -15,8 +15,8 @@ export declare function downloadByOnlineUrl(url: string, filename: string, mime?
15
15
  */
16
16
  export declare function downloadByBase64(buf: string, filename: string, mime?: string, bom?: BlobPart): void;
17
17
  export declare function uploaderFiles({ multiple, accept }?: {
18
- multiple?: boolean | undefined;
19
18
  accept?: string | undefined;
19
+ multiple?: boolean | undefined;
20
20
  }): Promise<File[]>;
21
21
  /**
22
22
  * Download according to the background interface file stream
@@ -1,3 +1,3 @@
1
1
  import { UploadTypeEnum } from '../../enums';
2
2
  export declare const sizeParser: (size: number) => string;
3
- export declare const typeParser: (fileName: string) => "attachment" | "img" | UploadTypeEnum.JPG | UploadTypeEnum.JPEG | UploadTypeEnum.PNG | UploadTypeEnum.BMP | UploadTypeEnum.DOCX | UploadTypeEnum.XLSX | UploadTypeEnum.DOC | UploadTypeEnum.MP4 | UploadTypeEnum.AVI | UploadTypeEnum.PPT | UploadTypeEnum.GIF | "MP4" | "PDF" | "ssl";
3
+ export declare const typeParser: (fileName: string) => "MP4" | "PDF" | "attachment" | "img" | "ssl" | UploadTypeEnum.JPG | UploadTypeEnum.JPEG | UploadTypeEnum.PNG | UploadTypeEnum.BMP | UploadTypeEnum.DOCX | UploadTypeEnum.XLSX | UploadTypeEnum.DOC | UploadTypeEnum.MP4 | UploadTypeEnum.AVI | UploadTypeEnum.PPT | UploadTypeEnum.GIF;
@@ -1,6 +1,5 @@
1
1
  import { PluginModeEnum } from '../../enums';
2
- import { IKitInfo } from '../../interface';
3
- import { App } from 'vue';
2
+ import { IPluginKitModule } from '../../interface';
4
3
  /**
5
4
  * 用于加载套件包的工具类
6
5
  *
@@ -8,25 +7,47 @@ import { App } from 'vue';
8
7
  * @class KitPkgUtil
9
8
  */
10
9
  export declare class KitPkgUtil {
11
- protected static readonly KIT_PKG_BASE_PATH = "/kits";
12
- protected static cache: Map<string, IKitInfo>;
10
+ protected static readonly KIT_PKG_BASE_PATH = "/plugin-kit";
13
11
  protected static joinPaths(...paths: string[]): string;
14
12
  /**
15
- * 加载套件包配置
13
+ * 加载套件包,返回套件包入口实例
16
14
  *
17
15
  * @static
18
16
  * @param {string} kit
19
- * @return {*} {(Promise<IKitInfo | undefined>)}
17
+ * @param {PluginModeEnum} mode
18
+ * @return {*} {(Promise<IPluginKitModule | null>)}
20
19
  */
21
- static loadKitPkgInfo(kit: string): Promise<IKitInfo | undefined>;
20
+ static loadKit(kit: string, mode: PluginModeEnum): Promise<IPluginKitModule | null>;
22
21
  /**
23
- * 加载套件包内的插件
22
+ * 加载设计模式套件包
24
23
  *
25
24
  * @static
26
- * @param {App} app
27
- * @param {(string | string[])} kit
28
- * @param {PluginModeEnum} mode
29
- * @return {*} {Promise<void>}
25
+ * @param {string} kit
26
+ * @return {*} {(Promise<IPluginKitModule | null>)}
27
+ */
28
+ static loadDesign(kit: string): Promise<IPluginKitModule | null>;
29
+ /**
30
+ * 加载移动端绘制模式套件包
31
+ *
32
+ * @static
33
+ * @param {string} kit
34
+ * @return {*} {(Promise<IPluginKitModule | null>)}
35
+ */
36
+ static loadMobile(kit: string): Promise<IPluginKitModule | null>;
37
+ /**
38
+ * 加载平板端绘制模式套件包
39
+ *
40
+ * @static
41
+ * @param {string} kit
42
+ * @return {*} {(Promise<IPluginKitModule | null>)}
43
+ */
44
+ static loadPad(kit: string): Promise<IPluginKitModule | null>;
45
+ /**
46
+ * 加载网页端绘制模式套件包
47
+ *
48
+ * @static
49
+ * @param {string} kit
50
+ * @return {*} {(Promise<IPluginKitModule | null>)}
30
51
  */
31
- static loadKits(app: App, kit: string | string[], mode: PluginModeEnum): Promise<void>;
52
+ static loadWeb(kit: string): Promise<IPluginKitModule | null>;
32
53
  }