@gct-paas/core 0.1.6-dev.2 → 0.1.6-dev.21
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 +2 -1
- package/dist/{redirect-index-Ck5Ddtcb.js → redirect-index-B_rzKQa2.js} +1 -0
- package/es/constants/core.d.ts +1 -0
- package/es/constants/core.mjs +27 -1
- package/es/constants/expression-type/modeCfg.mjs +6 -0
- package/es/constants/index.d.ts +1 -1
- package/es/create-app-vue.d.ts +1 -1
- package/es/create-app-vue.mjs +1 -1
- package/es/enums/app-designer/index.d.ts +29 -3
- package/es/enums/app-designer/index.mjs +33 -4
- package/es/enums/appEnum.d.ts +5 -1
- package/es/enums/appEnum.mjs +6 -1
- package/es/enums/authActionEnum.d.ts +5 -1
- package/es/enums/authActionEnum.mjs +4 -0
- package/es/enums/developer-center/integration.d.ts +6 -0
- package/es/enums/developer-center/integration.mjs +8 -1
- package/es/enums/expressionEnum.d.ts +4 -2
- package/es/enums/expressionEnum.mjs +2 -0
- package/es/enums/globalEnum.d.ts +47 -0
- package/es/enums/globalEnum.mjs +51 -1
- package/es/enums/index.d.ts +11 -0
- package/es/enums/index.mjs +13 -1
- package/es/enums/pageEnum.d.ts +2 -1
- package/es/enums/pageEnum.mjs +1 -0
- package/es/enums/process.d.ts +5 -0
- package/es/enums/process.mjs +9 -0
- package/es/enums/sizeEnum.d.ts +4 -0
- package/es/enums/sizeEnum.mjs +6 -1
- package/es/global/gct/gct.d.ts +15 -15
- package/es/global/gct/gct.mjs +4 -5
- package/es/hooks/index.d.ts +2 -0
- package/es/hooks/index.mjs +2 -0
- package/es/hooks/useDebouncePromise.d.ts +14 -0
- package/es/hooks/useDebouncePromise.mjs +56 -0
- package/es/hooks/useObserver.d.ts +13 -0
- package/es/hooks/useObserver.mjs +46 -0
- package/es/index.mjs +34 -18
- package/es/interface/i-action-item/i-action-item.d.ts +65 -0
- package/es/interface/i-app-context/i-app-context.d.ts +13 -0
- package/es/interface/i-dictionary/i-dictionary-item.d.ts +80 -0
- package/es/interface/i-kit-plugin-module/i-kit-plugin-module.d.ts +2 -2
- package/es/interface/i-pinia-action/i-global-actions.d.ts +3 -0
- package/es/interface/index.d.ts +2 -1
- package/es/interface/open-util/i-drawer-options/i-drawer-options.d.ts +298 -0
- package/es/interface/open-util/i-modal/i-modal.d.ts +14 -1
- package/es/interface/open-util/i-modal-data/i-modal-data.d.ts +3 -3
- package/es/interface/open-util/i-modal-options/i-modal-options.d.ts +2 -1
- package/es/interface/open-util/i-overlay-controller/i-overlay-controller.d.ts +9 -0
- package/es/interface/open-util/index.d.ts +1 -0
- package/es/locale/index.d.ts +2 -1
- package/es/modules/env-manager/env-manager.const.d.ts +2 -0
- package/es/modules/env-manager/env-manager.const.mjs +4 -2
- package/es/modules/env-manager/env-manager.d.ts +1 -13
- package/es/modules/env-manager/env-manager.interface.d.ts +6 -8
- package/es/modules/env-manager/env-manager.interface.mjs +2 -0
- package/es/modules/env-manager/env-manager.mjs +11 -26
- package/es/modules/env-manager/env-manager.util.d.ts +5 -0
- package/es/modules/env-manager/env-manager.util.mjs +11 -0
- package/es/modules/env-manager/index.d.ts +1 -0
- package/es/modules/env-manager/index.mjs +4 -0
- package/es/modules/platform-config/enums/login.enum.d.ts +3 -1
- package/es/modules/platform-config/enums/login.enum.mjs +2 -0
- package/es/modules/platform-config/store.d.ts +15 -15
- package/es/modules/platform-config/useDeploySetting.d.ts +1 -2
- package/es/modules/platform-config/useDeploySetting.mjs +6 -3
- package/es/modules/platform-config/useLoginSetting.d.ts +2 -2
- package/es/modules/platform-config/useLoginSetting.mjs +29 -31
- package/es/modules/platform-config/useOrgSetting.d.ts +2 -2
- package/es/modules/platform-config/useOrgSetting.mjs +4 -6
- package/es/modules/platform-config/useSecuritySetting.d.ts +2 -2
- package/es/modules/platform-config/useSecuritySetting.mjs +2 -3
- package/es/modules/platform-config/useWatermarkSetting.d.ts +5 -2
- package/es/modules/platform-config/useWatermarkSetting.mjs +2 -3
- package/es/modules/user-stores/store/tenant.store.d.ts +3 -5
- package/es/modules/user-stores/store/tenant.store.mjs +10 -12
- package/es/modules/user-stores/store/user.store.mjs +4 -4
- package/es/store/global-store.mjs +12 -4
- package/es/store/index.d.ts +1 -1
- package/es/store/session-store.d.ts +1 -0
- package/es/store/session-store.mjs +2 -1
- package/es/types/index.d.ts +13 -0
- package/es/utils/axios/interceptors.mjs +12 -0
- package/es/utils/deviceFingerprint.mjs +5 -1
- package/es/utils/i18n/index.mjs +1 -0
- package/es/utils/index.d.ts +3 -2
- package/es/utils/index.mjs +1 -0
- package/es/utils/namespace/namespace.mjs +1 -0
- package/es/utils/openUtil/modal/modal.d.ts +1 -1
- package/es/utils/openUtil/overlay-container/overlay-container.d.ts +1 -1
- package/es/utils/openUtil/overlay-container/overlay-container.mjs +28 -23
- package/es/utils/select-user-utils.d.ts +50 -0
- package/es/utils/select-user-utils.mjs +129 -0
- package/es/utils/tools/tools.d.ts +4 -2
- package/es/utils/tools/tools.mjs +20 -5
- package/package.json +3 -3
|
@@ -9,18 +9,18 @@ export declare const usePlatformConfigStore: import('pinia').StoreDefinition<"pl
|
|
|
9
9
|
deploySetting: {
|
|
10
10
|
deployMode: import('./enums').DeployModeEnum;
|
|
11
11
|
};
|
|
12
|
-
setDeploySetting: (data:
|
|
12
|
+
setDeploySetting: (data: IObject | undefined) => void;
|
|
13
13
|
isIndependentApp: import('vue').ComputedRef<boolean>;
|
|
14
14
|
loginSetting: import('@gct-paas/api/platform').AuthConfig;
|
|
15
15
|
postLoginSetting: () => Promise<void>;
|
|
16
|
-
setLoginSetting: (config:
|
|
16
|
+
setLoginSetting: (config: IObject | undefined) => void;
|
|
17
17
|
loginModeAuthTypes: import('vue').Ref<string[], string[]>;
|
|
18
18
|
openIDOAuthAuthTypes: import('vue').Ref<string[], string[]>;
|
|
19
19
|
sysLoginSort: import('vue').Ref<IObject[], IObject[]>;
|
|
20
20
|
openIDOAuthAuthSort: import('vue').Ref<IObject[], IObject[]>;
|
|
21
21
|
loginModeConfig: Map<string, IObject>;
|
|
22
22
|
orgSetting: import('@gct-paas/api/platform').OrgConfig;
|
|
23
|
-
setOrgSetting: (data:
|
|
23
|
+
setOrgSetting: (data: IObject) => void;
|
|
24
24
|
postOrgSetting: () => Promise<void>;
|
|
25
25
|
relationFields: import('vue').Ref<{
|
|
26
26
|
label: string;
|
|
@@ -47,7 +47,7 @@ export declare const usePlatformConfigStore: import('pinia').StoreDefinition<"pl
|
|
|
47
47
|
}[]>;
|
|
48
48
|
securitySetting: import('@gct-paas/api/platform').SecurityConfig;
|
|
49
49
|
postSecuritySetting: () => Promise<void>;
|
|
50
|
-
setSecuritySetting: (data:
|
|
50
|
+
setSecuritySetting: (data: IObject | undefined) => void;
|
|
51
51
|
getSignWay: () => "DOMAIN" | "LOGIN" | "SIGN";
|
|
52
52
|
themeSetting: import('./interfaces').IThemeSetting;
|
|
53
53
|
setThemeSetting: (data: SysConfigResponse) => void;
|
|
@@ -70,7 +70,7 @@ export declare const usePlatformConfigStore: import('pinia').StoreDefinition<"pl
|
|
|
70
70
|
height: number;
|
|
71
71
|
};
|
|
72
72
|
postWatermarkSetting: () => Promise<void>;
|
|
73
|
-
setWatermarkSetting: (data:
|
|
73
|
+
setWatermarkSetting: (data: IObject | undefined) => void;
|
|
74
74
|
projectSetting: {};
|
|
75
75
|
setProjectConfig: (config: {}) => void;
|
|
76
76
|
init: () => Promise<void>;
|
|
@@ -82,18 +82,18 @@ export declare const usePlatformConfigStore: import('pinia').StoreDefinition<"pl
|
|
|
82
82
|
deploySetting: {
|
|
83
83
|
deployMode: import('./enums').DeployModeEnum;
|
|
84
84
|
};
|
|
85
|
-
setDeploySetting: (data:
|
|
85
|
+
setDeploySetting: (data: IObject | undefined) => void;
|
|
86
86
|
isIndependentApp: import('vue').ComputedRef<boolean>;
|
|
87
87
|
loginSetting: import('@gct-paas/api/platform').AuthConfig;
|
|
88
88
|
postLoginSetting: () => Promise<void>;
|
|
89
|
-
setLoginSetting: (config:
|
|
89
|
+
setLoginSetting: (config: IObject | undefined) => void;
|
|
90
90
|
loginModeAuthTypes: import('vue').Ref<string[], string[]>;
|
|
91
91
|
openIDOAuthAuthTypes: import('vue').Ref<string[], string[]>;
|
|
92
92
|
sysLoginSort: import('vue').Ref<IObject[], IObject[]>;
|
|
93
93
|
openIDOAuthAuthSort: import('vue').Ref<IObject[], IObject[]>;
|
|
94
94
|
loginModeConfig: Map<string, IObject>;
|
|
95
95
|
orgSetting: import('@gct-paas/api/platform').OrgConfig;
|
|
96
|
-
setOrgSetting: (data:
|
|
96
|
+
setOrgSetting: (data: IObject) => void;
|
|
97
97
|
postOrgSetting: () => Promise<void>;
|
|
98
98
|
relationFields: import('vue').Ref<{
|
|
99
99
|
label: string;
|
|
@@ -120,7 +120,7 @@ export declare const usePlatformConfigStore: import('pinia').StoreDefinition<"pl
|
|
|
120
120
|
}[]>;
|
|
121
121
|
securitySetting: import('@gct-paas/api/platform').SecurityConfig;
|
|
122
122
|
postSecuritySetting: () => Promise<void>;
|
|
123
|
-
setSecuritySetting: (data:
|
|
123
|
+
setSecuritySetting: (data: IObject | undefined) => void;
|
|
124
124
|
getSignWay: () => "DOMAIN" | "LOGIN" | "SIGN";
|
|
125
125
|
themeSetting: import('./interfaces').IThemeSetting;
|
|
126
126
|
setThemeSetting: (data: SysConfigResponse) => void;
|
|
@@ -143,7 +143,7 @@ export declare const usePlatformConfigStore: import('pinia').StoreDefinition<"pl
|
|
|
143
143
|
height: number;
|
|
144
144
|
};
|
|
145
145
|
postWatermarkSetting: () => Promise<void>;
|
|
146
|
-
setWatermarkSetting: (data:
|
|
146
|
+
setWatermarkSetting: (data: IObject | undefined) => void;
|
|
147
147
|
projectSetting: {};
|
|
148
148
|
setProjectConfig: (config: {}) => void;
|
|
149
149
|
init: () => Promise<void>;
|
|
@@ -155,18 +155,18 @@ export declare const usePlatformConfigStore: import('pinia').StoreDefinition<"pl
|
|
|
155
155
|
deploySetting: {
|
|
156
156
|
deployMode: import('./enums').DeployModeEnum;
|
|
157
157
|
};
|
|
158
|
-
setDeploySetting: (data:
|
|
158
|
+
setDeploySetting: (data: IObject | undefined) => void;
|
|
159
159
|
isIndependentApp: import('vue').ComputedRef<boolean>;
|
|
160
160
|
loginSetting: import('@gct-paas/api/platform').AuthConfig;
|
|
161
161
|
postLoginSetting: () => Promise<void>;
|
|
162
|
-
setLoginSetting: (config:
|
|
162
|
+
setLoginSetting: (config: IObject | undefined) => void;
|
|
163
163
|
loginModeAuthTypes: import('vue').Ref<string[], string[]>;
|
|
164
164
|
openIDOAuthAuthTypes: import('vue').Ref<string[], string[]>;
|
|
165
165
|
sysLoginSort: import('vue').Ref<IObject[], IObject[]>;
|
|
166
166
|
openIDOAuthAuthSort: import('vue').Ref<IObject[], IObject[]>;
|
|
167
167
|
loginModeConfig: Map<string, IObject>;
|
|
168
168
|
orgSetting: import('@gct-paas/api/platform').OrgConfig;
|
|
169
|
-
setOrgSetting: (data:
|
|
169
|
+
setOrgSetting: (data: IObject) => void;
|
|
170
170
|
postOrgSetting: () => Promise<void>;
|
|
171
171
|
relationFields: import('vue').Ref<{
|
|
172
172
|
label: string;
|
|
@@ -193,7 +193,7 @@ export declare const usePlatformConfigStore: import('pinia').StoreDefinition<"pl
|
|
|
193
193
|
}[]>;
|
|
194
194
|
securitySetting: import('@gct-paas/api/platform').SecurityConfig;
|
|
195
195
|
postSecuritySetting: () => Promise<void>;
|
|
196
|
-
setSecuritySetting: (data:
|
|
196
|
+
setSecuritySetting: (data: IObject | undefined) => void;
|
|
197
197
|
getSignWay: () => "DOMAIN" | "LOGIN" | "SIGN";
|
|
198
198
|
themeSetting: import('./interfaces').IThemeSetting;
|
|
199
199
|
setThemeSetting: (data: SysConfigResponse) => void;
|
|
@@ -216,7 +216,7 @@ export declare const usePlatformConfigStore: import('pinia').StoreDefinition<"pl
|
|
|
216
216
|
height: number;
|
|
217
217
|
};
|
|
218
218
|
postWatermarkSetting: () => Promise<void>;
|
|
219
|
-
setWatermarkSetting: (data:
|
|
219
|
+
setWatermarkSetting: (data: IObject | undefined) => void;
|
|
220
220
|
projectSetting: {};
|
|
221
221
|
setProjectConfig: (config: {}) => void;
|
|
222
222
|
init: () => Promise<void>;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { SysConfigResponse } from '@gct-paas/api/platform';
|
|
2
1
|
import { DeployModeEnum } from './enums/deploy.enum';
|
|
3
2
|
/**
|
|
4
3
|
* 设置部署配置信息
|
|
5
4
|
* @param data - 系统配置响应数据
|
|
6
5
|
*/
|
|
7
|
-
declare function setDeploySetting(data:
|
|
6
|
+
declare function setDeploySetting(data: IObject | undefined): void;
|
|
8
7
|
/**
|
|
9
8
|
* 部署设置 Composable 函数
|
|
10
9
|
* @returns 返回部署设置相关的响应式数据和方法
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { DeployModeEnum } from "./enums/deploy.enum.mjs";
|
|
2
2
|
import { computed, reactive } from "vue";
|
|
3
3
|
//#region src/modules/platform-config/useDeploySetting.ts
|
|
4
|
+
/**
|
|
5
|
+
* 部署设置 Composable
|
|
6
|
+
* 用于管理应用的部署模式配置
|
|
7
|
+
*/
|
|
4
8
|
/** 部署设置响应式对象 */
|
|
5
9
|
var deploySetting = reactive({ deployMode: DeployModeEnum.STANDARD });
|
|
6
10
|
/** 是否为独立应用部署模式的计算属性 */
|
|
@@ -12,10 +16,9 @@ var isIndependentApp = computed(() => {
|
|
|
12
16
|
* @param data - 系统配置响应数据
|
|
13
17
|
*/
|
|
14
18
|
function setDeploySetting(data) {
|
|
15
|
-
|
|
16
|
-
if (!value) return;
|
|
19
|
+
if (!data || !data.id) return;
|
|
17
20
|
try {
|
|
18
|
-
Object.assign(deploySetting,
|
|
21
|
+
Object.assign(deploySetting, data);
|
|
19
22
|
} catch (err) {
|
|
20
23
|
console.warn(err);
|
|
21
24
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AuthConfig
|
|
1
|
+
import { AuthConfig } from '@gct-paas/api/platform';
|
|
2
2
|
/**
|
|
3
3
|
* 登录设置 Composable 函数
|
|
4
4
|
* @returns 返回登录设置相关的响应式数据和方法
|
|
@@ -6,7 +6,7 @@ import { AuthConfig, SysConfigResponse } from '@gct-paas/api/platform';
|
|
|
6
6
|
export declare function useLoginSetting(): {
|
|
7
7
|
loginSetting: AuthConfig;
|
|
8
8
|
postLoginSetting: () => Promise<void>;
|
|
9
|
-
setLoginSetting: (config:
|
|
9
|
+
setLoginSetting: (config: IObject | undefined) => void;
|
|
10
10
|
loginModeAuthTypes: import('vue').Ref<string[], string[]>;
|
|
11
11
|
openIDOAuthAuthTypes: import('vue').Ref<string[], string[]>;
|
|
12
12
|
sysLoginSort: import('vue').Ref<IObject[], IObject[]>;
|
|
@@ -106,39 +106,37 @@ function useLoginSetting() {
|
|
|
106
106
|
* @param config - 系统配置响应数据
|
|
107
107
|
*/
|
|
108
108
|
const setLoginSetting = (config) => {
|
|
109
|
-
if (config
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
enabled: 0
|
|
121
|
-
});
|
|
109
|
+
if (!config || !config.id) return;
|
|
110
|
+
for (const k in config) if (k in loginSetting) loginSetting[k] = config[k];
|
|
111
|
+
if (has(config, "sortJson") && !isEmpty(config.sortJson)) {
|
|
112
|
+
const sortObj = JSON.parse(config.sortJson);
|
|
113
|
+
if (has(sortObj, LoginSortTypeEnum.SYSTEM)) sysLoginSort.value = getLoginTypeOptions(sortObj[LoginSortTypeEnum.SYSTEM]);
|
|
114
|
+
if (has(sortObj, LoginSortTypeEnum.THIRD_PARTY)) openIDOAuthAuthSort.value = getLoginTypeOptions(sortObj[LoginSortTypeEnum.THIRD_PARTY]);
|
|
115
|
+
}
|
|
116
|
+
loginSetting.loginModeConfigs?.forEach((item) => {
|
|
117
|
+
loginModeConfig.set(item.authType, {
|
|
118
|
+
...item,
|
|
119
|
+
enabled: 0
|
|
122
120
|
});
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
121
|
+
});
|
|
122
|
+
const loginModeConfigs = loginSetting.loginModeConfigs?.filter((item) => {
|
|
123
|
+
return item.enabled;
|
|
124
|
+
}).map((i) => {
|
|
125
|
+
return i.authType;
|
|
126
|
+
}) || [];
|
|
127
|
+
loginModeConfigs.push(LoginTypeEnum.ACCOUNT);
|
|
128
|
+
loginModeAuthTypes.value = [...new Set(loginModeConfigs)];
|
|
129
|
+
loginSetting.openIDOAuthConfigs?.forEach((item) => {
|
|
130
|
+
loginModeConfig.set(item.authType, {
|
|
131
|
+
...item,
|
|
132
|
+
enabled: 0
|
|
135
133
|
});
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}
|
|
134
|
+
});
|
|
135
|
+
openIDOAuthAuthTypes.value = loginSetting.openIDOAuthConfigs?.filter((item) => {
|
|
136
|
+
return item.enabled;
|
|
137
|
+
}).map((i) => {
|
|
138
|
+
return i.authType;
|
|
139
|
+
}) || [];
|
|
142
140
|
};
|
|
143
141
|
return {
|
|
144
142
|
loginSetting,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OrgConfig
|
|
1
|
+
import { OrgConfig } from '@gct-paas/api/platform';
|
|
2
2
|
/**
|
|
3
3
|
* 组织设置 Composable 函数
|
|
4
4
|
* @param isPlatform - 是否为平台模式,默认为 true
|
|
@@ -6,7 +6,7 @@ import { OrgConfig, SysConfigResponse } from '@gct-paas/api/platform';
|
|
|
6
6
|
*/
|
|
7
7
|
export declare function useOrgSetting(isPlatform?: boolean): {
|
|
8
8
|
orgSetting: OrgConfig;
|
|
9
|
-
setOrgSetting: (data:
|
|
9
|
+
setOrgSetting: (data: IObject) => void;
|
|
10
10
|
postOrgSetting: () => Promise<void>;
|
|
11
11
|
relationFields: import('vue').Ref<{
|
|
12
12
|
label: string;
|
|
@@ -38,19 +38,17 @@ function useOrgSetting(isPlatform = true) {
|
|
|
38
38
|
* @param data - 系统配置响应数据
|
|
39
39
|
*/
|
|
40
40
|
function setOrgSetting(data) {
|
|
41
|
-
|
|
42
|
-
if (!value) return;
|
|
41
|
+
if (!data || !data.id) return;
|
|
43
42
|
try {
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
Object.assign(orgSetting, setting);
|
|
43
|
+
for (const key in data) if (key == "supportLoginFields") data["supportLoginFields"] = data["supportLoginFields"].filter((i) => i !== "username_");
|
|
44
|
+
Object.assign(orgSetting, data);
|
|
47
45
|
if (orgSetting.extFieldConfigs && orgSetting.extFieldConfigs.length) orgSetting.extFieldConfigs.forEach((element) => {
|
|
48
46
|
relationFields.value = relationFields.value.filter((i) => {
|
|
49
47
|
if (i.value == element.relationField) relationFiledsCopy.value.push(i);
|
|
50
48
|
return i.value !== element.relationField;
|
|
51
49
|
});
|
|
52
50
|
});
|
|
53
|
-
orgSetting.extFieldConfigs = JSON.parse(JSON.stringify(
|
|
51
|
+
orgSetting.extFieldConfigs = JSON.parse(JSON.stringify(data.extFieldConfigs));
|
|
54
52
|
} catch (err) {
|
|
55
53
|
console.warn(err);
|
|
56
54
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SecurityConfig
|
|
1
|
+
import { SecurityConfig } from '@gct-paas/api/platform';
|
|
2
2
|
/**
|
|
3
3
|
* 安全设置 Composable 函数
|
|
4
4
|
* @param isPlatform - 是否为平台模式,默认为 true
|
|
@@ -7,6 +7,6 @@ import { SecurityConfig, SysConfigResponse } from '@gct-paas/api/platform';
|
|
|
7
7
|
export declare function useSecuritySetting(isPlatform?: boolean): {
|
|
8
8
|
securitySetting: SecurityConfig;
|
|
9
9
|
postSecuritySetting: () => Promise<void>;
|
|
10
|
-
setSecuritySetting: (data:
|
|
10
|
+
setSecuritySetting: (data: IObject | undefined) => void;
|
|
11
11
|
getSignWay: () => "DOMAIN" | "LOGIN" | "SIGN";
|
|
12
12
|
};
|
|
@@ -54,10 +54,9 @@ function useSecuritySetting(isPlatform = true) {
|
|
|
54
54
|
* @param data - 系统配置响应数据
|
|
55
55
|
*/
|
|
56
56
|
function setSecuritySetting(data) {
|
|
57
|
-
|
|
58
|
-
if (!value) return;
|
|
57
|
+
if (!data || !data.id) return;
|
|
59
58
|
try {
|
|
60
|
-
Object.assign(securitySetting,
|
|
59
|
+
Object.assign(securitySetting, data);
|
|
61
60
|
} catch (err) {
|
|
62
61
|
console.warn(err);
|
|
63
62
|
}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* 水印设置 Composable
|
|
3
|
+
* 用于管理平台的水印配置
|
|
4
|
+
*/
|
|
2
5
|
/**
|
|
3
6
|
* 水印设置 Composable 函数
|
|
4
7
|
* @returns 返回水印设置相关的响应式数据和方法
|
|
@@ -17,5 +20,5 @@ export declare function useWatermarkSetting(): {
|
|
|
17
20
|
height: number;
|
|
18
21
|
};
|
|
19
22
|
postWatermarkSetting: () => Promise<void>;
|
|
20
|
-
setWatermarkSetting: (data:
|
|
23
|
+
setWatermarkSetting: (data: IObject | undefined) => void;
|
|
21
24
|
};
|
|
@@ -22,10 +22,9 @@ function useWatermarkSetting() {
|
|
|
22
22
|
* @param data - 系统配置响应数据
|
|
23
23
|
*/
|
|
24
24
|
function setWatermarkSetting(data) {
|
|
25
|
-
|
|
26
|
-
if (!value) return;
|
|
25
|
+
if (!data || !data.id) return;
|
|
27
26
|
try {
|
|
28
|
-
Object.assign(watermarkSetting,
|
|
27
|
+
Object.assign(watermarkSetting, data);
|
|
29
28
|
} catch (err) {
|
|
30
29
|
console.warn(err);
|
|
31
30
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { UserOfTenantDTO } from '@gct-paas/api/platform';
|
|
2
2
|
import { tenantState } from '../types/tenant';
|
|
3
|
-
export declare const useTenantStore: import('pinia').StoreDefinition<"tenant", tenantState, {
|
|
4
|
-
getTenantUserInfoAction(
|
|
5
|
-
|
|
6
|
-
} & import('pinia').PiniaCustomStateProperties<tenantState>): () => Promise<UserOfTenantDTO>;
|
|
7
|
-
}, {}>;
|
|
3
|
+
export declare const useTenantStore: import('pinia').StoreDefinition<"tenant", tenantState, {}, {
|
|
4
|
+
getTenantUserInfoAction(): Promise<UserOfTenantDTO>;
|
|
5
|
+
}>;
|
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { tenantRef } from "../../../utils/tools/tools.mjs";
|
|
2
2
|
import "../../../utils/index.mjs";
|
|
3
3
|
import { defineStore } from "pinia";
|
|
4
4
|
//#region src/modules/user-stores/store/tenant.store.ts
|
|
5
5
|
var useTenantStore = defineStore("tenant", {
|
|
6
6
|
state: () => ({ tenantUserInfo: {} }),
|
|
7
|
-
getters: {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
} },
|
|
17
|
-
actions: {}
|
|
7
|
+
getters: {},
|
|
8
|
+
actions: { async getTenantUserInfoAction() {
|
|
9
|
+
const tenantId = tenantRef.value;
|
|
10
|
+
if (!tenantId) return Promise.reject(null);
|
|
11
|
+
if (this.tenantUserInfo[tenantId]) return this.tenantUserInfo[tenantId];
|
|
12
|
+
const info = await _api.platform.tenant.getUserInfo();
|
|
13
|
+
this.tenantUserInfo[tenantId] = info;
|
|
14
|
+
return info;
|
|
15
|
+
} }
|
|
18
16
|
});
|
|
19
17
|
//#endregion
|
|
20
18
|
export { useTenantStore };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getToken, setToken, tenantRef } from "../../../utils/tools/tools.mjs";
|
|
2
2
|
import { sha256 } from "../../../utils/uuid/uuid.mjs";
|
|
3
3
|
import { getDeviceFingerprint, getPageIdentification } from "../../../utils/deviceFingerprint.mjs";
|
|
4
4
|
import "../../../utils/index.mjs";
|
|
@@ -23,7 +23,7 @@ var useUserStore = defineStore("user", {
|
|
|
23
23
|
},
|
|
24
24
|
/**用户信息下的租户信息 */
|
|
25
25
|
getTenantInfo(state) {
|
|
26
|
-
return state.userInfo?.tenantList?.find((i) => i.id ===
|
|
26
|
+
return state.userInfo?.tenantList?.find((i) => i.id === tenantRef.value);
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
actions: {
|
|
@@ -38,7 +38,7 @@ var useUserStore = defineStore("user", {
|
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
async getUserInfoAction(Token) {
|
|
41
|
-
if (!getToken && !Token) return null;
|
|
41
|
+
if (!getToken() && !Token) return null;
|
|
42
42
|
const info = await _api.platform.user.getInfo({ headers: { Token } });
|
|
43
43
|
this.setUserInfo(info);
|
|
44
44
|
this.userPermissions = (info?.platformManagerPermissions ?? []).reduce((map, item) => {
|
|
@@ -51,7 +51,7 @@ var useUserStore = defineStore("user", {
|
|
|
51
51
|
async afterLoginSingleApp() {},
|
|
52
52
|
/**登录后逻辑 */
|
|
53
53
|
async afterLoginAction() {
|
|
54
|
-
if (!getToken) return null;
|
|
54
|
+
if (!getToken()) return null;
|
|
55
55
|
},
|
|
56
56
|
/**退出登录 接口*/
|
|
57
57
|
async submitLoginOut() {
|
|
@@ -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
|
|
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();
|
|
@@ -41,12 +43,18 @@ var useGlobalStore = defineStore("global-store", {
|
|
|
41
43
|
},
|
|
42
44
|
/**加載运行时全局常量显示 */
|
|
43
45
|
async loadEmptySetting() {
|
|
44
|
-
const
|
|
45
|
-
if (!value) return;
|
|
46
|
-
Object.assign(this.globalSetting, JSON.parse(value));
|
|
46
|
+
const res = await _gct.api.apaas.basicConfig.getDetail({ configEnum: PlatformSettingEnum.GLOBAL });
|
|
47
|
+
if (!res?.value) return;
|
|
48
|
+
Object.assign(this.globalSetting, JSON.parse(res.value));
|
|
47
49
|
},
|
|
48
50
|
setProjectName(name) {
|
|
49
51
|
this.projectName = name;
|
|
52
|
+
},
|
|
53
|
+
updateUserInfo(data) {
|
|
54
|
+
this.userInfo = {
|
|
55
|
+
...this.userInfo,
|
|
56
|
+
...data
|
|
57
|
+
};
|
|
50
58
|
}
|
|
51
59
|
}
|
|
52
60
|
});
|
package/es/store/index.d.ts
CHANGED
|
@@ -1,7 +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
|
+
export { globalRefSession, ENV } from './session-store';
|
|
5
5
|
/**
|
|
6
6
|
* 全局的状态管理工具类
|
|
7
7
|
*
|
|
@@ -5,5 +5,6 @@ import { useSessionStorage } from "@vueuse/core";
|
|
|
5
5
|
var globalRefSession = useSessionStorage("GCT_GLOBAL_SESSION:PAAS", {
|
|
6
6
|
/**登录登出标识 */
|
|
7
7
|
currentPlatOrAppId: "" });
|
|
8
|
+
var ENV = useSessionStorage("ENV", "");
|
|
8
9
|
//#endregion
|
|
9
|
-
export { globalRefSession };
|
|
10
|
+
export { ENV, globalRefSession };
|
package/es/types/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import '@gct-paas/api/global-type';
|
|
3
3
|
import 'systemjs';
|
|
4
4
|
import 'vite/types/importMeta.d.ts';
|
|
5
|
+
import type { Composer } from 'vue-i18n';
|
|
5
6
|
import type { GctGlobal } from '../global';
|
|
6
7
|
import type { ApiManage as APaasApiManage } from '@gct-paas/api/apaas';
|
|
7
8
|
import type { ApiManage as PlatformApiManage } from '@gct-paas/api/platform';
|
|
@@ -49,6 +50,12 @@ declare global {
|
|
|
49
50
|
* @type {GlobalApi}
|
|
50
51
|
*/
|
|
51
52
|
_api: GlobalApi;
|
|
53
|
+
/**
|
|
54
|
+
* 多语言转换函数
|
|
55
|
+
*
|
|
56
|
+
* @type {Composer['t']}
|
|
57
|
+
*/
|
|
58
|
+
$t: Composer['t'];
|
|
52
59
|
/**
|
|
53
60
|
* wujie 微前端对象,当作为微前端子应用运行时可用
|
|
54
61
|
*
|
|
@@ -61,6 +68,12 @@ declare global {
|
|
|
61
68
|
* @type {ModuleFederation}
|
|
62
69
|
*/
|
|
63
70
|
// _mf: ModuleFederation;
|
|
71
|
+
/**
|
|
72
|
+
* 安卓混合开发模式标识,由原生层注入,值为 true 时表示在安卓混合开发模式下运行
|
|
73
|
+
*
|
|
74
|
+
* @type {boolean}
|
|
75
|
+
*/
|
|
76
|
+
__GCT_ANDROID__?: boolean;
|
|
64
77
|
}
|
|
65
78
|
|
|
66
79
|
interface ImportMetaEnv {
|
|
@@ -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 };
|
|
@@ -70,6 +70,10 @@ async function getDeviceFingerprint() {
|
|
|
70
70
|
if (isWeb) localStorage.setItem(FINGERPRINT_KEY, visitorId);
|
|
71
71
|
return `${name}/${visitorId}`;
|
|
72
72
|
}
|
|
73
|
+
/** web 端指纹(语义兼容) */
|
|
74
|
+
function getBrowserFingerprint() {
|
|
75
|
+
return getDeviceFingerprint();
|
|
76
|
+
}
|
|
73
77
|
/** mobile 端指纹(语义兼容) */
|
|
74
78
|
function getMobileBrowserFingerprint() {
|
|
75
79
|
return getDeviceFingerprint();
|
|
@@ -84,4 +88,4 @@ function getPageIdentification() {
|
|
|
84
88
|
return pageTag;
|
|
85
89
|
}
|
|
86
90
|
//#endregion
|
|
87
|
-
export { getDeviceFingerprint, getMobileBrowserFingerprint, getPageIdentification };
|
|
91
|
+
export { getBrowserFingerprint, getDeviceFingerprint, getMobileBrowserFingerprint, getPageIdentification };
|
package/es/utils/i18n/index.mjs
CHANGED
package/es/utils/index.d.ts
CHANGED
|
@@ -13,11 +13,11 @@ export * from './openUtil';
|
|
|
13
13
|
export { KitPkgUtil } from './kit-pkg-util/kit-pkg-util';
|
|
14
14
|
export { PluginPgkUtil, type IModuleMap, type LoadPluginResult, } from './plugin-pkg-util/plugin-pkg-util';
|
|
15
15
|
export { PluginStaticResource } from './plugin-static-resource/plugin-static-resource';
|
|
16
|
-
export { getToken, setToken, getTenant, isMobile, setTenant, deepMerge, stringifyMatrixParams, parseMatrixParams, createWhiteImageWithText, } from './tools/tools';
|
|
16
|
+
export { getToken, setToken, getTenant, tenantRef, isMobile, setTenant, deepMerge, stringifyMatrixParams, parseMatrixParams, createWhiteImageWithText, } from './tools/tools';
|
|
17
17
|
export * from './uuid/uuid';
|
|
18
18
|
export * from './value-helper/value-helper';
|
|
19
19
|
export { interceptors } from './axios/interceptors';
|
|
20
|
-
export { getDeviceFingerprint, getPageIdentification, getMobileBrowserFingerprint, } from './deviceFingerprint';
|
|
20
|
+
export { getDeviceFingerprint, getPageIdentification, getMobileBrowserFingerprint, getBrowserFingerprint, } from './deviceFingerprint';
|
|
21
21
|
export { TreeHelper } from './treeHelper/treeHelper';
|
|
22
22
|
export * from './style';
|
|
23
23
|
export * from './util';
|
|
@@ -34,3 +34,4 @@ export { scriptLoader, type IScriptOptions, } from './script-loader/script-loade
|
|
|
34
34
|
export { permission } from './permission';
|
|
35
35
|
export { getVueComponentByCode } from './vue-component-code';
|
|
36
36
|
export * from './data-prems/const';
|
|
37
|
+
export * from './select-user-utils';
|
package/es/utils/index.mjs
CHANGED
|
@@ -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;
|
|
@@ -61,7 +61,7 @@ export declare class OverlayContainer<O> implements IOverlayContainer {
|
|
|
61
61
|
* @param {O} [opts]
|
|
62
62
|
*/
|
|
63
63
|
constructor(component: unknown, render: (...args: any[]) => VNode, opts?: O | undefined);
|
|
64
|
-
static createVueApp(rootComponent: Component, rootProps?: IData):
|
|
64
|
+
static createVueApp(rootComponent: Component, rootProps?: IData): App<Element>;
|
|
65
65
|
/**
|
|
66
66
|
* 初始化飘窗
|
|
67
67
|
*
|