@gct-paas/core 0.1.6-dev.4 → 0.1.6-dev.40
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-CAuJHvTp.js} +1 -0
- package/es/_virtual/_rolldown/runtime.mjs +13 -0
- package/es/constants/expression-type/modeCfg.mjs +6 -0
- package/es/constants/index.d.ts +4 -0
- package/es/constants/index.mjs +5 -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 +30 -0
- package/es/enums/globalEnum.mjs +40 -1
- package/es/enums/index.d.ts +11 -0
- package/es/enums/index.mjs +13 -1
- package/es/enums/page-designer/designer.d.ts +2 -0
- package/es/enums/page-designer/designer.mjs +2 -0
- package/es/enums/page-designer/panel.d.ts +9 -2
- package/es/enums/page-designer/panel.mjs +10 -2
- 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 +25 -19
- package/es/global/gct/gct.mjs +10 -5
- package/es/hooks/index.d.ts +1 -0
- package/es/hooks/index.mjs +1 -0
- package/es/hooks/useDebouncePromise.d.ts +14 -0
- package/es/hooks/useDebouncePromise.mjs +56 -0
- package/es/index.d.ts +2 -0
- package/es/index.mjs +54 -34
- package/es/interface/i-action-item/i-action-item.d.ts +65 -0
- package/es/interface/i-app-context/i-app-context.d.ts +25 -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 +9 -0
- package/es/interface/i-pinia-getter/i-global-getters.d.ts +22 -1
- package/es/interface/i-pinia-state/i-global-state.d.ts +9 -2
- package/es/interface/index.d.ts +2 -1
- package/es/interface/open-util/i-confirm-util/i-confirm-util.d.ts +65 -0
- 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 +2 -0
- package/es/locale/auto-register.d.ts +2 -0
- package/es/locale/auto-register.mjs +13 -0
- package/es/locale/index.d.ts +17 -1
- package/es/locale/index.mjs +34 -0
- package/es/locale/sys/model.mjs +9 -0
- package/es/locale/sys.d.ts +17 -0
- package/es/locale/sys.mjs +26 -0
- 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 +8 -13
- package/es/modules/env-manager/env-manager.interface.d.ts +5 -9
- package/es/modules/env-manager/env-manager.interface.mjs +2 -0
- package/es/modules/env-manager/env-manager.mjs +20 -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/mqtt/interfaces/i-mqtt.d.ts +6 -2
- package/es/modules/mqtt/mqtt-client.d.ts +8 -7
- package/es/modules/mqtt/mqtt-client.mjs +30 -19
- package/es/modules/platform-config/constants/theme.const.d.ts +9 -1
- package/es/modules/platform-config/constants/theme.const.mjs +13 -2
- 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 +18 -18
- 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/useThemeSetting.d.ts +1 -1
- package/es/modules/platform-config/useThemeSetting.mjs +32 -4
- package/es/modules/platform-config/useWatermarkSetting.d.ts +5 -2
- package/es/modules/platform-config/useWatermarkSetting.mjs +2 -3
- package/es/modules/sign-log/index.d.ts +1 -0
- package/es/modules/sign-log/index.mjs +1 -0
- package/es/modules/sign-log/sign-log.d.ts +10 -0
- package/es/modules/sign-log/sign-log.mjs +109 -0
- package/es/modules/sign-log/sing-log.interface.d.ts +9 -0
- package/es/modules/system-mqtt/index.d.ts +2 -0
- package/es/modules/system-mqtt/index.mjs +1 -0
- package/es/modules/system-mqtt/system-mqtt.interface.d.ts +71 -0
- package/es/modules/system-mqtt/system-mqtt.service.d.ts +104 -0
- package/es/modules/system-mqtt/system-mqtt.service.mjs +199 -0
- package/es/modules/user-stores/store/permission.store.d.ts +1 -0
- package/es/modules/user-stores/store/permission.store.mjs +10 -0
- package/es/modules/user-stores/store/user.store.mjs +4 -2
- package/es/router/guard/index.d.ts +4 -0
- package/es/router/guard/index.mjs +41 -0
- package/es/router/index.mjs +2 -0
- package/es/setup-app.mjs +2 -9
- package/es/state/global-pinia-state/global-pinia-state.d.ts +6 -0
- package/es/state/global-pinia-state/global-pinia-state.mjs +6 -0
- package/es/store/global-store.mjs +18 -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/auth-util/auth-util.d.ts +37 -0
- package/es/utils/auth-util/auth-util.mjs +79 -0
- package/es/utils/axios/check-status.d.ts +1 -0
- package/es/utils/axios/check-status.mjs +64 -0
- package/es/utils/axios/interceptors.mjs +30 -0
- package/es/utils/deviceFingerprint.mjs +5 -1
- package/es/utils/i18n/index.mjs +1 -0
- package/es/utils/index.d.ts +4 -2
- package/es/utils/index.mjs +3 -1
- package/es/utils/namespace/namespace.mjs +1 -0
- package/es/utils/openUtil/modal/modal.d.ts +1 -1
- package/es/utils/openUtil/modal/modal.mjs +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 +6 -0
- package/es/utils/tools/tools.mjs +12 -3
- package/package.json +5 -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;
|
|
@@ -56,7 +56,7 @@ export declare const usePlatformConfigStore: import('pinia').StoreDefinition<"pl
|
|
|
56
56
|
toggleMenuCollapsed: () => void;
|
|
57
57
|
menuCollapsedWidth: number;
|
|
58
58
|
menuWidthRange: number[];
|
|
59
|
-
themeColors:
|
|
59
|
+
themeColors: readonly ["#026AC8", "#0DAA9C"];
|
|
60
60
|
watermarkSetting: {
|
|
61
61
|
openWatermark: boolean;
|
|
62
62
|
watermarkContent: string;
|
|
@@ -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;
|
|
@@ -129,7 +129,7 @@ export declare const usePlatformConfigStore: import('pinia').StoreDefinition<"pl
|
|
|
129
129
|
toggleMenuCollapsed: () => void;
|
|
130
130
|
menuCollapsedWidth: number;
|
|
131
131
|
menuWidthRange: number[];
|
|
132
|
-
themeColors:
|
|
132
|
+
themeColors: readonly ["#026AC8", "#0DAA9C"];
|
|
133
133
|
watermarkSetting: {
|
|
134
134
|
openWatermark: boolean;
|
|
135
135
|
watermarkContent: string;
|
|
@@ -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;
|
|
@@ -202,7 +202,7 @@ export declare const usePlatformConfigStore: import('pinia').StoreDefinition<"pl
|
|
|
202
202
|
toggleMenuCollapsed: () => void;
|
|
203
203
|
menuCollapsedWidth: number;
|
|
204
204
|
menuWidthRange: number[];
|
|
205
|
-
themeColors:
|
|
205
|
+
themeColors: readonly ["#026AC8", "#0DAA9C"];
|
|
206
206
|
watermarkSetting: {
|
|
207
207
|
openWatermark: boolean;
|
|
208
208
|
watermarkContent: string;
|
|
@@ -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,4 @@
|
|
|
1
|
-
import { MENU_WIDTH_RANGE, THEME_COLORS } from "./constants/theme.const.mjs";
|
|
1
|
+
import { MENU_WIDTH_RANGE, THEME_COLORS, THEME_COLOR_CLASS, THEME_COLOR_CLASS_MAP } from "./constants/theme.const.mjs";
|
|
2
2
|
import { reactive, ref, watch } from "vue";
|
|
3
3
|
//#region src/modules/platform-config/useThemeSetting.ts
|
|
4
4
|
/**
|
|
@@ -30,20 +30,48 @@ var menuCollapsedWidth = 46;
|
|
|
30
30
|
var menuWidthRange = MENU_WIDTH_RANGE;
|
|
31
31
|
/** 可选的主题颜色列表 */
|
|
32
32
|
var themeColors = THEME_COLORS;
|
|
33
|
+
function setThemeMode(mode) {
|
|
34
|
+
if (mode === "colorWeak") {
|
|
35
|
+
document.body.classList.add("color-weak");
|
|
36
|
+
document.body.classList.remove("gray-mode");
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
if (mode === "gray") {
|
|
40
|
+
document.body.classList.add("gray-mode");
|
|
41
|
+
document.body.classList.remove("color-weak");
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
document.body.classList.remove("gray-mode");
|
|
45
|
+
document.body.classList.remove("color-weak");
|
|
46
|
+
}
|
|
33
47
|
/**
|
|
34
48
|
* 切换颜色模式
|
|
35
49
|
* 根据当前颜色模式更新界面显示效果
|
|
36
50
|
*/
|
|
37
51
|
var toggleColorMode = () => {
|
|
38
52
|
switch (themeSetting.colorMode) {
|
|
39
|
-
case "colorWeak":
|
|
40
|
-
|
|
41
|
-
|
|
53
|
+
case "colorWeak":
|
|
54
|
+
setThemeMode("colorWeak");
|
|
55
|
+
break;
|
|
56
|
+
case "gray":
|
|
57
|
+
setThemeMode("gray");
|
|
58
|
+
break;
|
|
59
|
+
default: setThemeMode();
|
|
42
60
|
}
|
|
43
61
|
};
|
|
44
62
|
watch(() => themeSetting.colorMode, (value) => {
|
|
45
63
|
if (value) toggleColorMode();
|
|
46
64
|
});
|
|
65
|
+
function applyThemeColorClass(color) {
|
|
66
|
+
const normalized = color.toUpperCase();
|
|
67
|
+
const el = document.documentElement;
|
|
68
|
+
el.classList.remove(THEME_COLOR_CLASS);
|
|
69
|
+
const themeClass = THEME_COLOR_CLASS_MAP[normalized];
|
|
70
|
+
if (themeClass) el.classList.add(themeClass);
|
|
71
|
+
}
|
|
72
|
+
watch(() => themeSetting.themeColor, (value) => {
|
|
73
|
+
if (value) applyThemeColorClass(value);
|
|
74
|
+
}, { immediate: true });
|
|
47
75
|
/**
|
|
48
76
|
* 主题设置 Composable 函数
|
|
49
77
|
* @returns 返回主题设置相关的响应式数据和方法
|
|
@@ -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
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './sign-log';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./sign-log.mjs";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 注册登录/切换日志。
|
|
3
|
+
*
|
|
4
|
+
* @param type 切入平台(如 WORKTABLE、APPFRONT、ENTERPRISE)
|
|
5
|
+
* @param appId 切入应用 ID
|
|
6
|
+
* @param tenantId 切入租户 ID
|
|
7
|
+
*
|
|
8
|
+
* 流程:读取上下文 → 计算切换标志 → 上报 → 清理 signWay → 更新 session
|
|
9
|
+
*/
|
|
10
|
+
export declare function signLogRegister(type: string, appId: string, tenantId: string): Promise<void>;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { getBrowserFingerprint, getPageIdentification } from "../../utils/deviceFingerprint.mjs";
|
|
2
|
+
import "../../utils/index.mjs";
|
|
3
|
+
import { LoginTypeEnum } from "../platform-config/enums/login.enum.mjs";
|
|
4
|
+
import "../platform-config/index.mjs";
|
|
5
|
+
//#region src/modules/sign-log/sign-log.ts
|
|
6
|
+
/** 读取并解析上一次记录的平台上下文 */
|
|
7
|
+
function getPlatOrAppSession() {
|
|
8
|
+
const raw = sessionStorage.getItem("currentPlatOrAppId");
|
|
9
|
+
return {
|
|
10
|
+
hasSession: !!raw,
|
|
11
|
+
prev: raw ? JSON.parse(raw) : {}
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* 判定是否为租户切换。
|
|
16
|
+
* 例:在工作台从租户 A 切到租户 B → changeTenant=true
|
|
17
|
+
*/
|
|
18
|
+
function isChangeTenant(tenantId, hasSession, prev) {
|
|
19
|
+
return !!(tenantId && hasSession && prev.tenantId && tenantId !== prev.tenantId);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* 判定是否为应用切换(同平台内 appId 变化)。
|
|
23
|
+
*
|
|
24
|
+
* - samePlatformAppSwitch:通用场景,要求前后都有 appId 且平台类型不变
|
|
25
|
+
* - appFrontAppSwitch:APPFRONT 特例,允许 prev.appId 为空(首次进入某应用后再切换)
|
|
26
|
+
*/
|
|
27
|
+
function isChangeApp(type, appId, hasSession, prev) {
|
|
28
|
+
const samePlatformAppSwitch = !!(appId && hasSession && prev.appId && type === prev.type && appId !== prev.appId);
|
|
29
|
+
const appFrontAppSwitch = !!(hasSession && type === prev.type && appId !== prev.appId && type === "APPFRONT");
|
|
30
|
+
return samePlatformAppSwitch || appFrontAppSwitch;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* 判定是否为平台切换。
|
|
34
|
+
*
|
|
35
|
+
* 满足以下任一即视为平台上下文变化:
|
|
36
|
+
* - platformTypeChanged:平台类型变化(如 ENTERPRISE → APPFRONT)
|
|
37
|
+
* - firstPlatformEntry:无历史 session 的首次进入
|
|
38
|
+
* - sameNonAppFrontReentry:同类型重入,但非 APPFRONT(APPFRONT 内切换应用不算平台切换)
|
|
39
|
+
*
|
|
40
|
+
* 以下情况排除,避免与登录 / 租户切换混淆:
|
|
41
|
+
* - loginWithSignWay:首次登录选租户(session 无 tenant 但有 signWay),应记为登录而非平台切换
|
|
42
|
+
* - isChangeTenant:纯租户切换不算平台切换
|
|
43
|
+
*
|
|
44
|
+
* 额外分支 nonAppFrontColdStart:
|
|
45
|
+
* 非 APPFRONT 且无 session 的冷启动记为平台切换,
|
|
46
|
+
* 但 WORKTABLE 且无 tenantId 除外(无租户直接进企业管理后台的场景)
|
|
47
|
+
*/
|
|
48
|
+
function isChangePlatform(type, tenantId, signWay, hasSession, prev) {
|
|
49
|
+
const loginWithSignWay = !(hasSession && !!prev.tenantId) && !!tenantId && !!signWay;
|
|
50
|
+
const platformTypeChanged = !!(type && hasSession && prev.type && type !== prev.type);
|
|
51
|
+
const firstPlatformEntry = !!(type && !hasSession);
|
|
52
|
+
const sameNonAppFrontReentry = !!(hasSession && type === prev.type && type !== "APPFRONT");
|
|
53
|
+
return (platformTypeChanged || firstPlatformEntry || sameNonAppFrontReentry) && !loginWithSignWay && !isChangeTenant(tenantId, hasSession, prev) || type !== "APPFRONT" && !hasSession && !(type === "WORKTABLE" && !tenantId);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* 判定本次上报是否附带 signWay(登录方式)。
|
|
57
|
+
*
|
|
58
|
+
* - isNormalLogin:常规首次登录,session 无租户且非「WORKTABLE 无 tenantId」,
|
|
59
|
+
* APPFRONT 需有 appId,其他平台直接附带
|
|
60
|
+
* - isMicrosoftLogin:Microsoft 登录在选租户后仍需附带 signWay(OAuth 回调时 tenant 尚未确定)
|
|
61
|
+
*
|
|
62
|
+
* 附带后会在 postSignLog 完成后清除 sessionStorage 中的 signWay,避免后续切换误用
|
|
63
|
+
*/
|
|
64
|
+
function shouldAttachSignWay(type, appId, tenantId, signWay, hasSession, prev) {
|
|
65
|
+
const hasPrevTenant = hasSession && !!prev.tenantId;
|
|
66
|
+
const isMicrosoftLogin = signWay === `${LoginTypeEnum.MICROSOFT}_LOGIN` && !!tenantId;
|
|
67
|
+
return !hasPrevTenant && !(type === "WORKTABLE" && !tenantId) && !!signWay && (type === "APPFRONT" && !!appId || type !== "APPFRONT") || isMicrosoftLogin;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* 注册登录/切换日志。
|
|
71
|
+
*
|
|
72
|
+
* @param type 切入平台(如 WORKTABLE、APPFRONT、ENTERPRISE)
|
|
73
|
+
* @param appId 切入应用 ID
|
|
74
|
+
* @param tenantId 切入租户 ID
|
|
75
|
+
*
|
|
76
|
+
* 流程:读取上下文 → 计算切换标志 → 上报 → 清理 signWay → 更新 session
|
|
77
|
+
*/
|
|
78
|
+
async function signLogRegister(type, appId, tenantId) {
|
|
79
|
+
const signWay = sessionStorage.getItem("signWay");
|
|
80
|
+
const { hasSession, prev } = getPlatOrAppSession();
|
|
81
|
+
const fingerprint = await getBrowserFingerprint();
|
|
82
|
+
const env = _gct.env.getEnv();
|
|
83
|
+
const attachSignWay = shouldAttachSignWay(type, appId, tenantId, signWay, hasSession, prev);
|
|
84
|
+
const data = {
|
|
85
|
+
appId,
|
|
86
|
+
appIdOut: hasSession ? prev.appId ?? "" : "",
|
|
87
|
+
changeApp: isChangeApp(type, appId, hasSession, prev),
|
|
88
|
+
changePlatform: isChangePlatform(type, tenantId, signWay, hasSession, prev),
|
|
89
|
+
changeTenant: isChangeTenant(tenantId, hasSession, prev),
|
|
90
|
+
signWay: attachSignWay ? signWay : "",
|
|
91
|
+
platformIn: type,
|
|
92
|
+
platformOut: hasSession ? prev.type ?? "" : "",
|
|
93
|
+
env,
|
|
94
|
+
tenantIn: tenantId,
|
|
95
|
+
tenantOut: hasSession ? prev.tenantId ?? "" : ""
|
|
96
|
+
};
|
|
97
|
+
await _api.platform.signLog.post(data, { headers: {
|
|
98
|
+
pagetag: getPageIdentification(),
|
|
99
|
+
browser: fingerprint
|
|
100
|
+
} });
|
|
101
|
+
if (attachSignWay) sessionStorage.removeItem("signWay");
|
|
102
|
+
sessionStorage.setItem("currentPlatOrAppId", JSON.stringify({
|
|
103
|
+
appId,
|
|
104
|
+
type,
|
|
105
|
+
tenantId
|
|
106
|
+
}));
|
|
107
|
+
}
|
|
108
|
+
//#endregion
|
|
109
|
+
export { signLogRegister };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./system-mqtt.service.mjs";
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MQTT 订阅消息回调函数类型
|
|
3
|
+
*/
|
|
4
|
+
export type MqttSubCallback<T> = (payload?: T) => void | Promise<void>;
|
|
5
|
+
/**
|
|
6
|
+
* 登出消息
|
|
7
|
+
*
|
|
8
|
+
* @export
|
|
9
|
+
* @interface IKickOutPayload
|
|
10
|
+
*/
|
|
11
|
+
export interface IKickOutPayload {
|
|
12
|
+
/**
|
|
13
|
+
* 用户 token
|
|
14
|
+
*
|
|
15
|
+
* @type {string}
|
|
16
|
+
* @memberof IKickOutPayload
|
|
17
|
+
*/
|
|
18
|
+
token: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* 未读消息变化
|
|
22
|
+
*
|
|
23
|
+
* @export
|
|
24
|
+
* @interface IInternalMessagePayload
|
|
25
|
+
*/
|
|
26
|
+
export interface IInternalMessagePayload {
|
|
27
|
+
/**
|
|
28
|
+
* 全局未读消息数量
|
|
29
|
+
*
|
|
30
|
+
* @type {number}
|
|
31
|
+
*/
|
|
32
|
+
totalUnreadCount: number;
|
|
33
|
+
/**
|
|
34
|
+
* 应用未读消息数量
|
|
35
|
+
*
|
|
36
|
+
* @type {{
|
|
37
|
+
* appId: string;
|
|
38
|
+
* unreadCount: number;
|
|
39
|
+
* }}
|
|
40
|
+
*/
|
|
41
|
+
appMessageCount: {
|
|
42
|
+
appId: string;
|
|
43
|
+
unreadCount: number;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* 待办消息数量变化
|
|
48
|
+
*
|
|
49
|
+
* @export
|
|
50
|
+
* @interface IToDoMessagePayload
|
|
51
|
+
*/
|
|
52
|
+
export interface IToDoMessagePayload {
|
|
53
|
+
/**
|
|
54
|
+
* 待办消息数量
|
|
55
|
+
*
|
|
56
|
+
* @type {number}
|
|
57
|
+
*/
|
|
58
|
+
Count: number;
|
|
59
|
+
/**
|
|
60
|
+
* 应用待办消息数量
|
|
61
|
+
*
|
|
62
|
+
* @type {{
|
|
63
|
+
* appId: string;
|
|
64
|
+
* count: number;
|
|
65
|
+
* }}
|
|
66
|
+
*/
|
|
67
|
+
appMessageCount: {
|
|
68
|
+
appId: string;
|
|
69
|
+
count: number;
|
|
70
|
+
};
|
|
71
|
+
}
|