@gct-paas/core 0.1.5-dev.1 → 0.1.5-dev.11
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.
- package/dist/index.esm.min.js +1 -1
- package/es/enums/app-designer/index.d.ts +11 -0
- package/es/enums/app-designer/index.mjs +14 -1
- package/es/enums/appEnum.d.ts +8 -0
- package/es/enums/appEnum.mjs +10 -1
- package/es/enums/page-designer/designer.d.ts +13 -13
- package/es/enums/page-designer/widget.d.ts +2 -2
- package/es/global/gct/gct.d.ts +108 -107
- package/es/hooks/index.d.ts +1 -0
- package/es/hooks/index.mjs +1 -0
- package/es/hooks/useFile.d.ts +4 -0
- package/es/hooks/useFile.mjs +22 -0
- package/es/index.mjs +15 -6
- package/es/interface/i-kit-plugin-module/i-kit-plugin-module.d.ts +23 -0
- package/es/interface/i-pinia-action/i-global-actions.d.ts +3 -0
- package/es/interface/i-popover-options/i-popover-options.d.ts +98 -0
- package/es/interface/index.d.ts +3 -2
- package/es/interface/index.mjs +1 -0
- package/es/interface/model-designer/entity.d.ts +87 -79
- package/es/interface/model-designer/serial.d.ts +22 -0
- package/es/interface/model-designer/serial.mjs +49 -0
- package/es/interface/open-util/i-app-full-screen-container-options/i-app-full-screen-container-options.d.ts +26 -0
- package/es/interface/open-util/i-overlay-controller/i-overlay-controller.d.ts +52 -0
- package/es/interface/open-util/i-overlay-popover-container/i-overlay-popover-container.d.ts +21 -0
- package/es/interface/open-util/index.d.ts +3 -1
- package/es/locale/index.d.ts +26 -1
- package/es/locale/index.mjs +51 -3
- package/es/locale/sys/model.d.ts +5 -0
- package/es/locale/sys.d.ts +5 -0
- package/es/modules/mqtt/enums/mqtt-status.enum.d.ts +1 -0
- package/es/modules/mqtt/enums/mqtt-status.enum.mjs +2 -1
- package/es/modules/mqtt/mqtt-manager.d.ts +1 -1
- package/es/modules/mqtt/mqtt-manager.mjs +2 -1
- package/es/modules/platform-config/store.d.ts +106 -106
- package/es/modules/platform-config/store.mjs +0 -1
- package/es/modules/platform-config/useSecuritySetting.d.ts +1 -1
- package/es/modules/user-stores/store/tenant.store.d.ts +6 -8
- package/es/modules/user-stores/store/tenant.store.mjs +12 -14
- package/es/modules/user-stores/store/user.store.d.ts +11 -2
- package/es/modules/user-stores/store/user.store.mjs +15 -4
- package/es/modules/user-stores/types/tenant.d.ts +7 -1
- package/es/router/index.mjs +2 -2
- package/es/setup-app.mjs +6 -2
- package/es/store/global-store.mjs +3 -0
- package/es/store/index.d.ts +1 -0
- package/es/store/index.mjs +1 -0
- package/es/store/session-store.d.ts +7 -0
- package/es/store/session-store.mjs +7 -0
- package/es/store/storage-store.d.ts +2 -0
- package/es/store/storage-store.mjs +3 -2
- package/es/types/index.d.ts +0 -1
- package/es/utils/data-prems/const.d.ts +26 -0
- package/es/utils/data-prems/const.mjs +79 -0
- package/es/utils/file/download.d.ts +1 -1
- package/es/utils/file/parser.d.ts +1 -1
- package/es/utils/i18n/index.mjs +3 -0
- package/es/utils/index.d.ts +4 -0
- package/es/utils/index.mjs +5 -0
- package/es/utils/kit-pkg-util/kit-pkg-util.d.ts +34 -13
- package/es/utils/kit-pkg-util/kit-pkg-util.mjs +55 -40
- package/es/utils/openUtil/index.d.ts +1 -0
- package/es/utils/openUtil/index.mjs +1 -0
- package/es/utils/openUtil/overlay-popover-container/overlay-popover-container.d.ts +15 -0
- package/es/utils/openUtil/overlay-popover-container/overlay-popover-container.mjs +19 -0
- package/es/utils/plugin-pkg-util/plugin-pkg-util.d.ts +3 -3
- package/es/utils/plugin-pkg-util/plugin-pkg-util.mjs +1 -1
- package/es/utils/script-loader/script-loader.d.ts +62 -0
- package/es/utils/script-loader/script-loader.mjs +92 -0
- package/es/utils/style/index.d.ts +8 -0
- package/es/utils/style/index.mjs +67 -1
- package/es/utils/text-measure/text-measure.d.ts +141 -0
- package/es/utils/text-measure/text-measure.mjs +191 -0
- package/es/utils/tools/tools.d.ts +1 -1
- package/es/utils/uploader/uploader.mjs +3 -5
- package/es/utils/util.d.ts +1 -0
- package/es/utils/util.mjs +9 -1
- package/es/utils/vue-component-code.d.ts +8 -0
- package/es/utils/vue-component-code.mjs +37 -0
- package/package.json +20 -20
- package/es/interface/i-import-style-map/i-import-style-map.d.ts +0 -15
- package/es/interface/i-kit-info/i-kit-info.d.ts +0 -20
|
@@ -63,7 +63,7 @@ export declare class MqttManager implements IMqttManager {
|
|
|
63
63
|
* @param instanceId 实例唯一标识
|
|
64
64
|
* @returns 客户端实例,若不存在则返回 undefined
|
|
65
65
|
*/
|
|
66
|
-
get(instanceId
|
|
66
|
+
get(instanceId?: string): IMqttClient | undefined;
|
|
67
67
|
/**
|
|
68
68
|
* 判断指定实例是否已存在
|
|
69
69
|
*
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DEFAULT_MQTT_INSTANCE_ID } from "./enums/mqtt-status.enum.mjs";
|
|
1
2
|
import { MqttClient } from "./mqtt-client.mjs";
|
|
2
3
|
import { createUUID } from "qx-util";
|
|
3
4
|
//#region src/modules/mqtt/mqtt-manager.ts
|
|
@@ -77,7 +78,7 @@ var MqttManager = class {
|
|
|
77
78
|
* @param instanceId 实例唯一标识
|
|
78
79
|
* @returns 客户端实例,若不存在则返回 undefined
|
|
79
80
|
*/
|
|
80
|
-
get(instanceId) {
|
|
81
|
+
get(instanceId = DEFAULT_MQTT_INSTANCE_ID) {
|
|
81
82
|
return this._clients.get(instanceId);
|
|
82
83
|
}
|
|
83
84
|
/**
|
|
@@ -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
|
-
|
|
7
|
-
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
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
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
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
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
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
|
-
}, "
|
|
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>;
|
|
@@ -46,7 +46,6 @@ var usePlatformConfigStore = defineStore("platform-config", () => {
|
|
|
46
46
|
if (map[PlatformSettingEnum.THEME]) theme.setThemeSetting(map[PlatformSettingEnum.THEME]);
|
|
47
47
|
if (map[PlatformSettingEnum.WATERMARK]) watermark.setWatermarkSetting(map[PlatformSettingEnum.WATERMARK]);
|
|
48
48
|
if (map[PlatformSettingEnum.DEPLOY]) deploy.setDeploySetting(map[PlatformSettingEnum.DEPLOY]);
|
|
49
|
-
console.debug("平台配置初始化完成", map);
|
|
50
49
|
}
|
|
51
50
|
/**应用前台设置初始化 */
|
|
52
51
|
async function renderInit() {
|
|
@@ -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: () => "
|
|
11
|
+
getSignWay: () => "DOMAIN" | "LOGIN" | "SIGN";
|
|
12
12
|
};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { UserOfTenantDTO } from '@gct-paas/api/platform';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
|
|
13
|
+
state.tenantUserInfo[tenantId] = info;
|
|
17
14
|
return info;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
15
|
+
};
|
|
16
|
+
} },
|
|
17
|
+
actions: {}
|
|
20
18
|
});
|
|
21
19
|
//#endregion
|
|
22
20
|
export { useTenantStore };
|
|
@@ -44,6 +44,7 @@ export declare const useUserStore: import('pinia').StoreDefinition<"user", UserS
|
|
|
44
44
|
duty?: string | undefined;
|
|
45
45
|
enabled?: number | undefined;
|
|
46
46
|
id?: string | undefined;
|
|
47
|
+
latestLogin?: number | undefined;
|
|
47
48
|
managerId?: string | undefined;
|
|
48
49
|
managerName?: string | undefined;
|
|
49
50
|
name?: string | undefined;
|
|
@@ -115,6 +116,7 @@ export declare const useUserStore: import('pinia').StoreDefinition<"user", UserS
|
|
|
115
116
|
duty?: string | undefined;
|
|
116
117
|
enabled?: number | undefined;
|
|
117
118
|
id?: string | undefined;
|
|
119
|
+
latestLogin?: number | undefined;
|
|
118
120
|
managerId?: string | undefined;
|
|
119
121
|
managerName?: string | undefined;
|
|
120
122
|
name?: string | undefined;
|
|
@@ -183,6 +185,7 @@ export declare const useUserStore: import('pinia').StoreDefinition<"user", UserS
|
|
|
183
185
|
duty?: string | undefined;
|
|
184
186
|
enabled?: number | undefined;
|
|
185
187
|
id?: string | undefined;
|
|
188
|
+
latestLogin?: number | undefined;
|
|
186
189
|
managerId?: string | undefined;
|
|
187
190
|
managerName?: string | undefined;
|
|
188
191
|
name?: string | undefined;
|
|
@@ -257,6 +260,7 @@ export declare const useUserStore: import('pinia').StoreDefinition<"user", UserS
|
|
|
257
260
|
duty?: string | undefined;
|
|
258
261
|
enabled?: number | undefined;
|
|
259
262
|
id?: string | undefined;
|
|
263
|
+
latestLogin?: number | undefined;
|
|
260
264
|
managerId?: string | undefined;
|
|
261
265
|
managerName?: string | undefined;
|
|
262
266
|
name?: string | undefined;
|
|
@@ -290,13 +294,18 @@ export declare const useUserStore: import('pinia').StoreDefinition<"user", UserS
|
|
|
290
294
|
}, {
|
|
291
295
|
login(config: LoginParams, { hasError }?: {
|
|
292
296
|
hasError: any;
|
|
293
|
-
}): Promise<
|
|
297
|
+
}): Promise<UserLoginResp>;
|
|
294
298
|
getUserInfoAction(Token?: string): Promise<UserLoginResp | null>;
|
|
295
299
|
/**单应用登录 */
|
|
296
300
|
afterLoginSingleApp(): Promise<void>;
|
|
297
301
|
/**登录后逻辑 */
|
|
298
302
|
afterLoginAction(): Promise<null | undefined>;
|
|
299
|
-
|
|
303
|
+
/**退出登录 接口*/
|
|
304
|
+
submitLoginOut(): Promise<void>;
|
|
305
|
+
/**
|
|
306
|
+
* 清空对应信息
|
|
307
|
+
*/
|
|
308
|
+
appLoginOut(): Promise<void>;
|
|
300
309
|
setUserInfo(info: IObject): Promise<void>;
|
|
301
310
|
updateUserInfo(data: IObject): Promise<void>;
|
|
302
311
|
}>;
|
|
@@ -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
|
-
|
|
32
|
+
globalRefStorage.value.signWay = signWay || "";
|
|
30
33
|
setToken(token);
|
|
31
|
-
return this.
|
|
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
|
|
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(
|
|
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
|
package/es/router/index.mjs
CHANGED
|
@@ -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.
|
|
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.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,13 @@ 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 (error) {
|
|
24
|
+
console.error("获取用户信息失败", error);
|
|
25
|
+
}
|
|
22
26
|
}
|
|
23
27
|
//#endregion
|
|
24
28
|
export { setupApp };
|
package/es/store/index.d.ts
CHANGED
package/es/store/index.mjs
CHANGED
|
@@ -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
|
/**
|
|
@@ -2,9 +2,10 @@ import { useStorage } from "@vueuse/core";
|
|
|
2
2
|
/**
|
|
3
3
|
* 全局双向绑定持续化缓存Map
|
|
4
4
|
*/
|
|
5
|
-
var globalRefStorage = useStorage("
|
|
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 };
|
package/es/types/index.d.ts
CHANGED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 分类的模块类型
|
|
3
|
+
*/
|
|
4
|
+
export declare enum CategoryModuleEnum {
|
|
5
|
+
/** 在线表单 */
|
|
6
|
+
ONLINE_FORM = "online_form_module",
|
|
7
|
+
/** eDHR */
|
|
8
|
+
EDHR = "edhr_module",
|
|
9
|
+
/** 单据项目 */
|
|
10
|
+
CHECK_LIST = "check_list_module",
|
|
11
|
+
/** 检验模板 */
|
|
12
|
+
INSPECTION = "inspection_module",
|
|
13
|
+
/** 放行模板 */
|
|
14
|
+
RELEASE = "release_module"
|
|
15
|
+
}
|
|
16
|
+
export type GetInterfaceParams = {
|
|
17
|
+
moduleType: CategoryModuleEnum;
|
|
18
|
+
} & IObject;
|
|
19
|
+
export declare const getInterfaceApi: {
|
|
20
|
+
/** 获取分类列表 */
|
|
21
|
+
getCategoryList: ({ moduleType }: {
|
|
22
|
+
moduleType: CategoryModuleEnum;
|
|
23
|
+
}) => Promise<object>;
|
|
24
|
+
/** 获取模板列表 */
|
|
25
|
+
getTmplsList: (params: GetInterfaceParams, config?: IObject) => Promise<object>;
|
|
26
|
+
};
|