@pubinfo/core 2.0.13 → 2.0.14
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/{AppSetting-Df8mPhxN.js → AppSetting-Bfabd02_.js} +27 -27
- package/dist/{HCheckList.vue_vue_type_script_setup_true_lang-CD2VmdPG.js → HCheckList.vue_vue_type_script_setup_true_lang-LHEWLVoX.js} +1 -1
- package/dist/{HToggle-CcxWxVmB.js → HToggle-B3C623BZ.js} +1 -1
- package/dist/HeaderThinMenu-B6cpu5jx.js +4 -0
- package/dist/{PreferencesContent-Bu8-g2qs.js → PreferencesContent-B42MPjzA.js} +57 -57
- package/dist/{SettingBreadcrumb-CTLEf4nt.js → SettingBreadcrumb-D3GS-3MN.js} +5 -5
- package/dist/{SettingCopyright-B_ZS9FXO.js → SettingCopyright-KDpCggiE.js} +4 -4
- package/dist/{SettingEnableTransition-DgZyY8Rh.js → SettingEnableTransition-BF27WYg0.js} +14 -14
- package/dist/{SettingHome-BN6WzWxX.js → SettingHome-DWyDzFcn.js} +4 -4
- package/dist/{SettingMenu-CNgEpRN_.js → SettingMenu-Dz0fbIa3.js} +4 -4
- package/dist/{SettingMode-B_Sf7CqN.js → SettingMode-AD_S9ZkO.js} +9 -9
- package/dist/{SettingNavSearch-SQuD6lr7.js → SettingNavSearch-oWIPjQFc.js} +4 -4
- package/dist/{SettingOther-CrgOHNra.js → SettingOther-ZlPSoHz3.js} +10 -10
- package/dist/{SettingPage-B4hfRME8.js → SettingPage-BnwAMror.js} +2 -2
- package/dist/{SettingTabbar-7EcsmyZo.js → SettingTabbar-Vvz-1zTa.js} +25 -25
- package/dist/{SettingThemes-CVjQoEk4.js → SettingThemes-CLhV2OOt.js} +16 -16
- package/dist/{SettingToolbar-Bls_SdlL.js → SettingToolbar-nCkGwG2H.js} +7 -7
- package/dist/{SettingTopbar-jqUqG5vW.js → SettingTopbar-DMujCz4n.js} +5 -5
- package/dist/{SettingWidthMode-8LFo6UKy.js → SettingWidthMode-7qsluuMR.js} +3 -3
- package/dist/core/resolver/layout.d.ts +1 -1
- package/dist/features/api/modules/auth/renzhengfuwu.d.ts +43 -1
- package/dist/features/api/modules/rbac/index.d.ts +1 -0
- package/dist/features/api/modules/rbac/yonghujiekou.d.ts +7 -0
- package/dist/features/api/modules/rbac/ziyuandaorudaochuxiangguanjiekou.d.ts +43 -0
- package/dist/features/api/modules/rbac/ziyuanjiekou.d.ts +7 -0
- package/dist/features/enum.d.ts +0 -1
- package/dist/features/stores/modules/iframe.d.ts +3 -3
- package/dist/{index-Dw9-vGGZ.js → index-2Zh2rSjN.js} +8551 -7697
- package/dist/{index-Dalsj2EI.js → index-BN5BYOEh.js} +12012 -11892
- package/dist/{index-Bl4PBBmY.js → index-BaRQkDKe.js} +1 -1
- package/dist/{index-C6HIzbdv.js → index-D210UZpV.js} +1 -1
- package/dist/{index-Cc8zVLOC.js → index-DQnnCCLU.js} +4 -4
- package/dist/{index-BX0RSX9i.js → index-DSNuCtw6.js} +1 -1
- package/dist/{index-Cjl98Ty_.js → index-XjjX4TvH.js} +17 -17
- package/dist/index-iASxH_cj.js +4 -0
- package/dist/index.js +27 -27
- package/dist/{pick-Cghe_Z7L.js → pick-BZcCK3Xe.js} +1 -1
- package/dist/style.css +1 -1
- package/package.json +14 -9
- package/runtime/components/PubinfoDev/index.d.ts +18 -0
- package/runtime/components/PubinfoDev/index.js +15 -0
- package/runtime/components/index.d.ts +1 -0
- package/runtime/components/index.js +1 -0
- package/runtime/index.d.ts +1 -0
- package/runtime/index.js +1 -0
- package/src/built-in/authorization/router.ts +1 -1
- package/src/built-in/layout-component/components/Content/IframeView.vue +16 -11
- package/src/built-in/layout-component/components/Content/index.vue +2 -1
- package/src/built-in/settings/router.ts +15 -4
- package/src/built-in/system-info/components/SystemInfo.vue +67 -37
- package/src/core/resolver/layout.ts +13 -3
- package/src/features/api/modules/auth/index.ts +0 -2
- package/src/features/api/modules/auth/renzhengfuwu.ts +132 -1
- package/src/features/api/modules/auth/typings.d.ts +75 -1
- package/src/features/api/modules/configData/heibaimingdanfuwu.ts +2 -0
- package/src/features/api/modules/configData/index.ts +0 -2
- package/src/features/api/modules/configData/zidifuwu.ts +4 -0
- package/src/features/api/modules/rbac/gangweijiekou.ts +3 -0
- package/src/features/api/modules/rbac/index.ts +1 -2
- package/src/features/api/modules/rbac/typings.d.ts +97 -1
- package/src/features/api/modules/rbac/yonghujiekou.ts +25 -0
- package/src/features/api/modules/rbac/yonghushoucangbiaojiekou.ts +2 -0
- package/src/features/api/modules/rbac/yonghuzuijinchangyongbiaojiekou.ts +1 -0
- package/src/features/api/modules/rbac/ziyuandaorudaochuxiangguanjiekou.ts +158 -0
- package/src/features/api/modules/rbac/ziyuanjiekou.ts +21 -0
- package/src/features/enum.ts +1 -1
- package/src/features/stores/modules/iframe.ts +12 -3
- package/src/features/stores/modules/route.ts +3 -2
- package/types/global.d.ts +5 -0
- package/types/vue-router.d.ts +2 -2
- package/dist/HeaderThinMenu-BMjyPDYS.js +0 -4
- package/dist/index-CUbMQSBZ.js +0 -4
- package/src/features/components/MicroAppContainer/index.vue +0 -9
package/package.json
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pubinfo/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.14",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
8
|
"default": "./dist/index.js"
|
|
9
9
|
},
|
|
10
|
+
"./runtime": {
|
|
11
|
+
"types": "./runtime/index.d.ts",
|
|
12
|
+
"default": "./runtime/index.js"
|
|
13
|
+
},
|
|
10
14
|
"./style.css": "./dist/style.css",
|
|
11
15
|
"./types": "./dist/index.d.ts"
|
|
12
16
|
},
|
|
@@ -15,6 +19,7 @@
|
|
|
15
19
|
"types": "./dist/index.d.ts",
|
|
16
20
|
"files": [
|
|
17
21
|
"dist",
|
|
22
|
+
"runtime",
|
|
18
23
|
"src",
|
|
19
24
|
"types"
|
|
20
25
|
],
|
|
@@ -26,9 +31,9 @@
|
|
|
26
31
|
"pinia": "^3.0.3",
|
|
27
32
|
"vue": "^3.5.17",
|
|
28
33
|
"vue-router": "^4.5.1",
|
|
29
|
-
"@pubinfo/config": "2.0.
|
|
30
|
-
"@pubinfo/devtools": "2.0.
|
|
31
|
-
"@pubinfo/vite": "2.0.
|
|
34
|
+
"@pubinfo/config": "2.0.14",
|
|
35
|
+
"@pubinfo/devtools": "2.0.14",
|
|
36
|
+
"@pubinfo/vite": "2.0.14"
|
|
32
37
|
},
|
|
33
38
|
"dependencies": {
|
|
34
39
|
"@alova/adapter-axios": "^2.0.16",
|
|
@@ -36,7 +41,7 @@
|
|
|
36
41
|
"@ant-design/icons-vue": "^7.0.1",
|
|
37
42
|
"@headlessui/vue": "^1.7.23",
|
|
38
43
|
"@imengyu/vue3-context-menu": "^1.5.1",
|
|
39
|
-
"@pubinfo/pro-components": "^1.
|
|
44
|
+
"@pubinfo/pro-components": "^1.8.0",
|
|
40
45
|
"@unocss/reset": "^66.4.2",
|
|
41
46
|
"@vueuse/core": "^13.7.0",
|
|
42
47
|
"@vueuse/integrations": "^13.5.0",
|
|
@@ -65,8 +70,8 @@
|
|
|
65
70
|
"@alova/mock": "^2.0.17",
|
|
66
71
|
"@iconify/json": "^2.2.354",
|
|
67
72
|
"@iconify/vue": "^5.0.0",
|
|
68
|
-
"@pubinfo/openapi": "^0.9.
|
|
69
|
-
"@pubinfo/preset-openapi": "^0.9.
|
|
73
|
+
"@pubinfo/openapi": "^0.9.1",
|
|
74
|
+
"@pubinfo/preset-openapi": "^0.9.1",
|
|
70
75
|
"@types/lodash-es": "^4.17.12",
|
|
71
76
|
"@types/md5": "^2.3.5",
|
|
72
77
|
"@types/nprogress": "^0.2.3",
|
|
@@ -87,8 +92,8 @@
|
|
|
87
92
|
"vite-plugin-dts": "^4.5.4",
|
|
88
93
|
"vue": "^3.5.17",
|
|
89
94
|
"vue-router": "^4.5.1",
|
|
90
|
-
"@pubinfo/config": "2.0.
|
|
91
|
-
"@pubinfo/vite": "2.0.
|
|
95
|
+
"@pubinfo/config": "2.0.14",
|
|
96
|
+
"@pubinfo/vite": "2.0.14"
|
|
92
97
|
},
|
|
93
98
|
"scripts": {
|
|
94
99
|
"dev": "vite build -w -m watch",
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/* prettier-ignore */
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
// noinspection JSUnusedGlobalSymbols
|
|
5
|
+
// biome-ignore lint: disable
|
|
6
|
+
|
|
7
|
+
import type { SlotsType, VNode } from 'vue';
|
|
8
|
+
|
|
9
|
+
declare const _default: import('vue').DefineComponent<{}, () => VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
10
|
+
[key: string]: any
|
|
11
|
+
}>[] | undefined, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, SlotsType<{
|
|
12
|
+
default?: () => VNode[]
|
|
13
|
+
/**
|
|
14
|
+
* If you ever require to have a replacement during production.
|
|
15
|
+
*/
|
|
16
|
+
fallback?: () => VNode[]
|
|
17
|
+
}>, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { defineComponent } from 'vue';
|
|
2
|
+
|
|
3
|
+
export default defineComponent({
|
|
4
|
+
name: 'PubinfoDev',
|
|
5
|
+
inheritAttrs: false,
|
|
6
|
+
...import.meta.env.DEV && {
|
|
7
|
+
slots: Object,
|
|
8
|
+
},
|
|
9
|
+
setup(_, props) {
|
|
10
|
+
if (import.meta.env.DEV) {
|
|
11
|
+
return () => props.slots.default?.();
|
|
12
|
+
}
|
|
13
|
+
return () => props.slots.fallback?.();
|
|
14
|
+
},
|
|
15
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as PubinfoDev } from './PubinfoDev/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as PubinfoDev } from './PubinfoDev/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|
package/runtime/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|
|
@@ -13,8 +13,9 @@ const { settingsStore, iframeStore } = useContext();
|
|
|
13
13
|
|
|
14
14
|
const iframeRef = ref();
|
|
15
15
|
|
|
16
|
-
//
|
|
17
|
-
|
|
16
|
+
// 第三方登录后的实际地址(仅首次初始化)
|
|
17
|
+
// key: route.fullPath, value: 登录后实际跳转的 url
|
|
18
|
+
const partyLoginUrlMap = reactive(new Map<string, string>());
|
|
18
19
|
|
|
19
20
|
watch(() => route.fullPath, async (val) => {
|
|
20
21
|
nextTick(() => {
|
|
@@ -31,25 +32,29 @@ watch(() => route.fullPath, async (val) => {
|
|
|
31
32
|
const partyLogin = route.meta?.partyLogin as PartyLoginConfig | undefined;
|
|
32
33
|
const iframeUrl = route.meta?.iframe as string | undefined;
|
|
33
34
|
|
|
35
|
+
// 如果已经初始化过该路由的 URL,直接使用(避免重复触发第三方登录)
|
|
36
|
+
if (partyLoginUrlMap.has(val)) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// 第一次进入:处理第三方登录
|
|
34
41
|
if (partyLogin && Array.isArray(partyLogin) && partyLogin.length > 0 && iframeUrl) {
|
|
35
42
|
const { url } = await usePartyLogin(partyLogin, iframeUrl);
|
|
36
43
|
watch(url, (newUrl) => {
|
|
37
|
-
if (newUrl) {
|
|
38
|
-
|
|
44
|
+
if (newUrl && !partyLoginUrlMap.has(val)) {
|
|
45
|
+
// 仅初始化一次,后续不再变更
|
|
46
|
+
partyLoginUrlMap.set(val, newUrl);
|
|
39
47
|
}
|
|
40
48
|
}, { immediate: true });
|
|
41
49
|
}
|
|
42
|
-
else {
|
|
43
|
-
partyLoginUrl.value = '';
|
|
44
|
-
}
|
|
45
50
|
},
|
|
46
51
|
{
|
|
47
52
|
immediate: true,
|
|
48
53
|
});
|
|
49
54
|
|
|
50
|
-
// 计算 iframe 的实际 src
|
|
51
|
-
function getIframeSrc(itemSrc: string): string {
|
|
52
|
-
return
|
|
55
|
+
// 计算 iframe 的实际 src(仅返回初始地址或第三方登录后的地址)
|
|
56
|
+
function getIframeSrc(itemSrc: string, path: string): string {
|
|
57
|
+
return partyLoginUrlMap.get(path) || itemSrc;
|
|
53
58
|
}
|
|
54
59
|
</script>
|
|
55
60
|
|
|
@@ -66,7 +71,7 @@ function getIframeSrc(itemSrc: string): string {
|
|
|
66
71
|
v-show="route.fullPath === item.path"
|
|
67
72
|
ref="iframeRef"
|
|
68
73
|
:data-path="item.path"
|
|
69
|
-
:src="getIframeSrc(item.src)"
|
|
74
|
+
:src="getIframeSrc(item.src, item.path)"
|
|
70
75
|
frameborder="0"
|
|
71
76
|
class="h-full w-full flex-1"
|
|
72
77
|
/>
|
|
@@ -69,7 +69,8 @@ watch(
|
|
|
69
69
|
mode="out-in" appear
|
|
70
70
|
>
|
|
71
71
|
<KeepAlive :include="keepAliveStore.list">
|
|
72
|
-
|
|
72
|
+
<!-- 为了解决 micro-app 的问题,key 只能为 route.name -->
|
|
73
|
+
<component :is="Component" v-show="!(isIframe || isLink)" :key="route.name" class="page-container" />
|
|
73
74
|
</KeepAlive>
|
|
74
75
|
</Transition>
|
|
75
76
|
</component>
|
|
@@ -90,11 +90,22 @@ export function createRouterGuard(router: Router) {
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
if (from.meta.iframe) {
|
|
93
|
-
|
|
94
|
-
const
|
|
93
|
+
// 判断是否启用 iframe 缓存(保留 DOM 实例)
|
|
94
|
+
const shouldCacheIframe = from.meta.iframeCache === true;
|
|
95
95
|
|
|
96
|
-
if (
|
|
97
|
-
|
|
96
|
+
if (shouldCacheIframe) {
|
|
97
|
+
// 启用缓存:不销毁 iframe,仅标记为非激活(保留 DOM)
|
|
98
|
+
// 不调用 close,让 iframe 保持在 openedList 中
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
// 未启用缓存:根据常规缓存规则判断是否销毁
|
|
102
|
+
const isCache = hitCache(to.name as string, from.meta.cache, from.meta.noCache);
|
|
103
|
+
const toReload = to.name === 'Reload';
|
|
104
|
+
|
|
105
|
+
if (!isCache || toReload) {
|
|
106
|
+
// 真正销毁 iframe(destroy = true)
|
|
107
|
+
iframeStore.close(from.fullPath, true);
|
|
108
|
+
}
|
|
98
109
|
}
|
|
99
110
|
}
|
|
100
111
|
});
|
|
@@ -5,49 +5,79 @@ import HSlideover from '@/built-in/layout-component/components/ui/HSlideover.vue
|
|
|
5
5
|
|
|
6
6
|
const [visible, toggle] = useToggle(false);
|
|
7
7
|
|
|
8
|
-
const { pkg, buildTime } = __SYSTEM_INFO__;
|
|
8
|
+
const { pkg, buildTime, git } = __SYSTEM_INFO__;
|
|
9
9
|
hotkeys('alt+i', () => toggle());
|
|
10
10
|
</script>
|
|
11
11
|
|
|
12
12
|
<template>
|
|
13
13
|
<HSlideover v-model="visible" title="系统信息">
|
|
14
|
-
<div class="
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
<div class="text-dark dark:text-light">
|
|
15
|
+
<div class="px-4">
|
|
16
|
+
<h2 class="m-0 text-lg font-bold">
|
|
17
|
+
最后编译时间
|
|
18
|
+
</h2>
|
|
19
|
+
<div class="my-4 text-center text-lg font-sans">
|
|
20
|
+
{{ buildTime }}
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
<div class="px-4">
|
|
24
|
+
<h2 class="m-0 text-lg font-bold">
|
|
25
|
+
生产环境依赖
|
|
26
|
+
</h2>
|
|
27
|
+
<ul class="list-none pl-0 text-sm">
|
|
28
|
+
<li v-for="(val, key) in (pkg.dependencies as object)" :key="key" class="flex items-center justify-between rounded px-2 py-1.5 hover:bg-stone-1 dark:hover:bg-stone-9">
|
|
29
|
+
<div class="font-bold">
|
|
30
|
+
{{ key }}
|
|
31
|
+
</div>
|
|
32
|
+
<div class="font-sans">
|
|
33
|
+
{{ val }}
|
|
34
|
+
</div>
|
|
35
|
+
</li>
|
|
36
|
+
</ul>
|
|
37
|
+
</div>
|
|
38
|
+
<div class="px-4">
|
|
39
|
+
<h2 class="m-0 text-lg font-bold">
|
|
40
|
+
开发环境依赖
|
|
41
|
+
</h2>
|
|
42
|
+
<ul class="list-none pl-0 text-sm">
|
|
43
|
+
<li v-for="(val, key) in (pkg.devDependencies as object)" :key="key" class="flex items-center justify-between rounded px-2 py-1.5 hover:bg-stone-1 dark:hover:bg-stone-9">
|
|
44
|
+
<div class="font-bold">
|
|
45
|
+
{{ key }}
|
|
46
|
+
</div>
|
|
47
|
+
<div class="font-sans">
|
|
48
|
+
{{ val }}
|
|
49
|
+
</div>
|
|
50
|
+
</li>
|
|
51
|
+
</ul>
|
|
52
|
+
</div>
|
|
53
|
+
<div v-if="git" class="px-4">
|
|
54
|
+
<h2 class="m-0 text-lg font-bold">
|
|
55
|
+
Git 信息
|
|
56
|
+
</h2>
|
|
57
|
+
<ul class="list-none pl-0 text-sm">
|
|
58
|
+
<li class="flex items-center justify-between rounded px-2 py-1.5 hover:bg-stone-1 dark:hover:bg-stone-9">
|
|
59
|
+
<div class="font-bold">
|
|
60
|
+
编译分支
|
|
61
|
+
</div>
|
|
62
|
+
<div class="font-sans">
|
|
63
|
+
{{ git.branch }}
|
|
64
|
+
</div>
|
|
65
|
+
</li>
|
|
66
|
+
<li class="flex items-center justify-between rounded px-2 py-1.5 hover:bg-stone-1 dark:hover:bg-stone-9">
|
|
67
|
+
<div class="font-bold">
|
|
68
|
+
最新提交提交哈希
|
|
69
|
+
</div>
|
|
70
|
+
<a-tooltip>
|
|
71
|
+
<template #title>
|
|
72
|
+
{{ git.commit }}
|
|
73
|
+
</template>
|
|
74
|
+
<div class="font-sans">
|
|
75
|
+
{{ git.commitShort }}
|
|
76
|
+
</div>
|
|
77
|
+
</a-tooltip>
|
|
78
|
+
</li>
|
|
79
|
+
</ul>
|
|
20
80
|
</div>
|
|
21
|
-
</div>
|
|
22
|
-
<div class="px-4">
|
|
23
|
-
<h2 class="m-0 text-lg font-bold">
|
|
24
|
-
生产环境依赖
|
|
25
|
-
</h2>
|
|
26
|
-
<ul class="list-none pl-0 text-sm">
|
|
27
|
-
<li v-for="(val, key) in (pkg.dependencies as object)" :key="key" class="flex items-center justify-between rounded px-2 py-1.5 hover:bg-stone-1 dark:hover:bg-stone-9">
|
|
28
|
-
<div class="font-bold">
|
|
29
|
-
{{ key }}
|
|
30
|
-
</div>
|
|
31
|
-
<div class="font-sans">
|
|
32
|
-
{{ val }}
|
|
33
|
-
</div>
|
|
34
|
-
</li>
|
|
35
|
-
</ul>
|
|
36
|
-
</div>
|
|
37
|
-
<div class="px-4">
|
|
38
|
-
<h2 class="m-0 text-lg font-bold">
|
|
39
|
-
开发环境依赖
|
|
40
|
-
</h2>
|
|
41
|
-
<ul class="list-none pl-0 text-sm">
|
|
42
|
-
<li v-for="(val, key) in (pkg.devDependencies as object)" :key="key" class="flex items-center justify-between rounded px-2 py-1.5 hover:bg-stone-1 dark:hover:bg-stone-9">
|
|
43
|
-
<div class="font-bold">
|
|
44
|
-
{{ key }}
|
|
45
|
-
</div>
|
|
46
|
-
<div class="font-sans">
|
|
47
|
-
{{ val }}
|
|
48
|
-
</div>
|
|
49
|
-
</li>
|
|
50
|
-
</ul>
|
|
51
81
|
</div>
|
|
52
82
|
</HSlideover>
|
|
53
83
|
</template>
|
|
@@ -2,12 +2,22 @@ import type { ProjectModules } from './resolver';
|
|
|
2
2
|
import { readProjectModules } from './resolver';
|
|
3
3
|
|
|
4
4
|
/** 选择默认的布局组件 */
|
|
5
|
-
function selectDefaultLayout(layouts: ProjectModules['layouts']): (() => Promise<any>) | null {
|
|
5
|
+
function selectDefaultLayout(layouts: ProjectModules['layouts'], name?: string): (() => Promise<any>) | null {
|
|
6
6
|
const entries = Object.entries(layouts ?? {});
|
|
7
7
|
if (entries.length === 0) {
|
|
8
8
|
return null;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
if (name) {
|
|
12
|
+
const match = entries.find(([path]) => {
|
|
13
|
+
const filename = path.split('/').pop()?.replace(/\.vue$/, '');
|
|
14
|
+
return filename === name;
|
|
15
|
+
});
|
|
16
|
+
if (match) {
|
|
17
|
+
return match[1];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
11
21
|
if (entries.length === 1) {
|
|
12
22
|
return entries[0][1];
|
|
13
23
|
}
|
|
@@ -17,7 +27,7 @@ function selectDefaultLayout(layouts: ProjectModules['layouts']): (() => Promise
|
|
|
17
27
|
}
|
|
18
28
|
|
|
19
29
|
/** 设置默认布局组件 */
|
|
20
|
-
export function setupDefaultLayout() {
|
|
30
|
+
export function setupDefaultLayout(name?: string) {
|
|
21
31
|
const modules = readProjectModules();
|
|
22
|
-
return selectDefaultLayout(modules?.layouts);
|
|
32
|
+
return selectDefaultLayout(modules?.layouts, name);
|
|
23
33
|
}
|
|
@@ -1,5 +1,44 @@
|
|
|
1
1
|
import { auth as request } from '@/features/api/request';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* @description 验证码-前端校验 需要校验的验证码类型:blockPuzzle、clickWord
|
|
5
|
+
* @url /auth/captcha/check
|
|
6
|
+
* @method POST
|
|
7
|
+
* @author @pubinfo/openapi
|
|
8
|
+
*/
|
|
9
|
+
export function postAuthCaptchaCheck<
|
|
10
|
+
R = API.ResponseDataValidCodeVo,
|
|
11
|
+
T = API.ResponseDataValidCodeVo,
|
|
12
|
+
>(
|
|
13
|
+
body: API.CaptchaCheckDto,
|
|
14
|
+
options?: Parameters<typeof request.Post<R, T>>[2],
|
|
15
|
+
) {
|
|
16
|
+
return request.Post<R, T>('/auth/captcha/check', body, {
|
|
17
|
+
headers: {
|
|
18
|
+
'Content-Type': 'application/json',
|
|
19
|
+
},
|
|
20
|
+
...(options || {}),
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @description 验证码-获取验证码图片
|
|
26
|
+
* @url /auth/captcha/get
|
|
27
|
+
* @method POST
|
|
28
|
+
* @author @pubinfo/openapi
|
|
29
|
+
*/
|
|
30
|
+
export function postAuthCaptchaGet<
|
|
31
|
+
R = API.ResponseDataValidCodeVo,
|
|
32
|
+
T = API.ResponseDataValidCodeVo,
|
|
33
|
+
>(body: API.CaptchaGetDto, options?: Parameters<typeof request.Post<R, T>>[2]) {
|
|
34
|
+
return request.Post<R, T>('/auth/captcha/get', body, {
|
|
35
|
+
headers: {
|
|
36
|
+
'Content-Type': 'application/json',
|
|
37
|
+
},
|
|
38
|
+
...(options || {}),
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
3
42
|
/**
|
|
4
43
|
* @description 切换登录组织
|
|
5
44
|
* @url /auth/changeLoginOrg
|
|
@@ -46,6 +85,27 @@ export function getAuthCheckCacheToken<
|
|
|
46
85
|
});
|
|
47
86
|
}
|
|
48
87
|
|
|
88
|
+
/**
|
|
89
|
+
* @description 根据用户id获取用户token列表
|
|
90
|
+
* @url /auth/getTokenListByUserId
|
|
91
|
+
* @method GET
|
|
92
|
+
* @author @pubinfo/openapi
|
|
93
|
+
*/
|
|
94
|
+
export function getAuthGetTokenListByUserId<
|
|
95
|
+
R = API.ResponseDataListPubLoginTokenVo,
|
|
96
|
+
T = API.ResponseDataListPubLoginTokenVo,
|
|
97
|
+
>(
|
|
98
|
+
params: API.getAuthGetTokenListByUserIdParams,
|
|
99
|
+
options?: Parameters<typeof request.Get<R, T>>[1],
|
|
100
|
+
) {
|
|
101
|
+
return request.Get<R, T>('/auth/getTokenListByUserId', {
|
|
102
|
+
params: {
|
|
103
|
+
...params,
|
|
104
|
+
},
|
|
105
|
+
...(options || {}),
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
|
|
49
109
|
/**
|
|
50
110
|
* @description 密码登录
|
|
51
111
|
* @url /auth/login
|
|
@@ -101,7 +161,28 @@ export function getAuthLoginValidCode<
|
|
|
101
161
|
}
|
|
102
162
|
|
|
103
163
|
/**
|
|
104
|
-
* @description
|
|
164
|
+
* @description 验证码-密码登录
|
|
165
|
+
* @url /auth/loginNew
|
|
166
|
+
* @method POST
|
|
167
|
+
* @author @pubinfo/openapi
|
|
168
|
+
*/
|
|
169
|
+
export function postAuthLoginNew<
|
|
170
|
+
R = API.ResponseDataLoginTokenVo,
|
|
171
|
+
T = API.ResponseDataLoginTokenVo,
|
|
172
|
+
>(
|
|
173
|
+
body: API.LoginByPwdCaptchaDto,
|
|
174
|
+
options?: Parameters<typeof request.Post<R, T>>[2],
|
|
175
|
+
) {
|
|
176
|
+
return request.Post<R, T>('/auth/loginNew', body, {
|
|
177
|
+
headers: {
|
|
178
|
+
'Content-Type': 'application/json',
|
|
179
|
+
},
|
|
180
|
+
...(options || {}),
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* @description 当前用户登出
|
|
105
186
|
* @url /auth/loginOut
|
|
106
187
|
* @method POST
|
|
107
188
|
* @author @pubinfo/openapi
|
|
@@ -119,6 +200,56 @@ export function postAuthLoginOut<
|
|
|
119
200
|
);
|
|
120
201
|
}
|
|
121
202
|
|
|
203
|
+
/**
|
|
204
|
+
* @description 用户id登出
|
|
205
|
+
* @url /auth/loginOutByUserId
|
|
206
|
+
* @method POST
|
|
207
|
+
* @author @pubinfo/openapi
|
|
208
|
+
*/
|
|
209
|
+
export function postAuthLoginOutByUserId<
|
|
210
|
+
R = API.ResponseDataVoid,
|
|
211
|
+
T = API.ResponseDataVoid,
|
|
212
|
+
>(
|
|
213
|
+
params: API.postAuthLoginOutByUserIdParams,
|
|
214
|
+
options?: Parameters<typeof request.Post<R, T>>[2],
|
|
215
|
+
) {
|
|
216
|
+
return request.Post<R, T>(
|
|
217
|
+
'/auth/loginOutByUserId',
|
|
218
|
+
{},
|
|
219
|
+
{
|
|
220
|
+
params: {
|
|
221
|
+
...params,
|
|
222
|
+
},
|
|
223
|
+
...(options || {}),
|
|
224
|
+
},
|
|
225
|
+
);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* @description 用户id和设备类型登出
|
|
230
|
+
* @url /auth/loginOutByUserIdAndDevType
|
|
231
|
+
* @method POST
|
|
232
|
+
* @author @pubinfo/openapi
|
|
233
|
+
*/
|
|
234
|
+
export function postAuthLoginOutByUserIdAndDevType<
|
|
235
|
+
R = API.ResponseDataVoid,
|
|
236
|
+
T = API.ResponseDataVoid,
|
|
237
|
+
>(
|
|
238
|
+
params: API.postAuthLoginOutByUserIdAndDevTypeParams,
|
|
239
|
+
options?: Parameters<typeof request.Post<R, T>>[2],
|
|
240
|
+
) {
|
|
241
|
+
return request.Post<R, T>(
|
|
242
|
+
'/auth/loginOutByUserIdAndDevType',
|
|
243
|
+
{},
|
|
244
|
+
{
|
|
245
|
+
params: {
|
|
246
|
+
...params,
|
|
247
|
+
},
|
|
248
|
+
...(options || {}),
|
|
249
|
+
},
|
|
250
|
+
);
|
|
251
|
+
}
|
|
252
|
+
|
|
122
253
|
/**
|
|
123
254
|
* @description 单点免密登录接口
|
|
124
255
|
* @url /auth/ssoLogin
|
|
@@ -1,8 +1,34 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
// @ts-nocheck
|
|
3
3
|
declare namespace API {
|
|
4
|
+
type CaptchaCheckDto = {
|
|
5
|
+
/** 类型 clickWord:文字、blockPuzzle:滑块 */
|
|
6
|
+
captchaType: string;
|
|
7
|
+
/** 加密坐标 */
|
|
8
|
+
pointJson: string;
|
|
9
|
+
/** token */
|
|
10
|
+
token: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
type CaptchaGetDto = {
|
|
14
|
+
/** 类型 clickWord:文字、blockPuzzle:滑块、imageCode:图片 */
|
|
15
|
+
captchaType?: string;
|
|
16
|
+
/** 客户端UI组件id */
|
|
17
|
+
clientUid?: string;
|
|
18
|
+
/** 时间戳 1751542686180 */
|
|
19
|
+
ts?: string;
|
|
20
|
+
/** 尺寸(长x宽),例:150x50表示长为150宽为50,不填默认150x50,最大尺寸:长500,宽200 */
|
|
21
|
+
size?: string;
|
|
22
|
+
/** 验证码长度,不填默认4位 */
|
|
23
|
+
length?: string;
|
|
24
|
+
};
|
|
25
|
+
|
|
4
26
|
type getAuthCheckCacheTokenParams = {
|
|
5
27
|
accessToken: string;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
type getAuthGetTokenListByUserIdParams = {
|
|
31
|
+
/** 用户id */
|
|
6
32
|
userId: string;
|
|
7
33
|
};
|
|
8
34
|
|
|
@@ -14,11 +40,26 @@ declare namespace API {
|
|
|
14
40
|
};
|
|
15
41
|
|
|
16
42
|
type IResponseCode = {
|
|
17
|
-
code?: number;
|
|
18
43
|
msg?: string;
|
|
44
|
+
code?: number;
|
|
19
45
|
hint?: string;
|
|
20
46
|
};
|
|
21
47
|
|
|
48
|
+
type LoginByPwdCaptchaDto = {
|
|
49
|
+
/** 登录类型 */
|
|
50
|
+
loginType: string;
|
|
51
|
+
/** 登录名 */
|
|
52
|
+
loginName: string;
|
|
53
|
+
/** 密码 */
|
|
54
|
+
loginPwd: string;
|
|
55
|
+
/** imageCode:验证码hash/其他:加密后的token,AES.encode(token+"---"+pointListStr, key) */
|
|
56
|
+
codeHash: string;
|
|
57
|
+
/** 验证码 imageCode类型必填 */
|
|
58
|
+
code?: string;
|
|
59
|
+
/** 验证码类型,clickWord:文字、blockPuzzle:滑块、imageCode(默认):图片 */
|
|
60
|
+
captchaType?: string;
|
|
61
|
+
};
|
|
62
|
+
|
|
22
63
|
type LoginByPwdDto = {
|
|
23
64
|
/** 登录类型 */
|
|
24
65
|
loginType: string;
|
|
@@ -45,11 +86,36 @@ declare namespace API {
|
|
|
45
86
|
orgId: string;
|
|
46
87
|
};
|
|
47
88
|
|
|
89
|
+
type postAuthLoginOutByUserIdAndDevTypeParams = {
|
|
90
|
+
/** 用户id */
|
|
91
|
+
userId: string;
|
|
92
|
+
/** 设备类型 */
|
|
93
|
+
devType: string;
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
type postAuthLoginOutByUserIdParams = {
|
|
97
|
+
/** 用户id */
|
|
98
|
+
userId: string;
|
|
99
|
+
};
|
|
100
|
+
|
|
48
101
|
type postAuthTokenRefreshParams = {
|
|
49
102
|
/** 刷新令牌 */
|
|
50
103
|
refreshToken: string;
|
|
51
104
|
};
|
|
52
105
|
|
|
106
|
+
type PubLoginTokenVo = {
|
|
107
|
+
/** id */
|
|
108
|
+
id?: string;
|
|
109
|
+
/** 服务名称 */
|
|
110
|
+
appName?: string;
|
|
111
|
+
/** 用户id */
|
|
112
|
+
userId?: string;
|
|
113
|
+
/** 创建时间 */
|
|
114
|
+
createTime?: string;
|
|
115
|
+
/** 设备dev */
|
|
116
|
+
devType?: string;
|
|
117
|
+
};
|
|
118
|
+
|
|
53
119
|
type ResponseDataBoolean = {
|
|
54
120
|
code?: number;
|
|
55
121
|
msg?: string;
|
|
@@ -58,6 +124,14 @@ declare namespace API {
|
|
|
58
124
|
success?: boolean;
|
|
59
125
|
};
|
|
60
126
|
|
|
127
|
+
type ResponseDataListPubLoginTokenVo = {
|
|
128
|
+
code?: number;
|
|
129
|
+
msg?: string;
|
|
130
|
+
hint?: string;
|
|
131
|
+
data?: PubLoginTokenVo[];
|
|
132
|
+
success?: boolean;
|
|
133
|
+
};
|
|
134
|
+
|
|
61
135
|
type ResponseDataLoginTokenVo = {
|
|
62
136
|
code?: number;
|
|
63
137
|
msg?: string;
|
|
@@ -38,6 +38,7 @@ export function getBlackWhiteListDeleteById<
|
|
|
38
38
|
return request.Get<R, T>(`/blackWhiteList/delete/${param0}`, {
|
|
39
39
|
params: { ...queryParams },
|
|
40
40
|
...(options || {}),
|
|
41
|
+
meta: { ...(options?.meta ?? {}), pathParams: [param0] },
|
|
41
42
|
});
|
|
42
43
|
}
|
|
43
44
|
|
|
@@ -58,6 +59,7 @@ export function getBlackWhiteListGetBlackWhiteListById<
|
|
|
58
59
|
return request.Get<R, T>(`/blackWhiteList/getBlackWhiteList/${param0}`, {
|
|
59
60
|
params: { ...queryParams },
|
|
60
61
|
...(options || {}),
|
|
62
|
+
meta: { ...(options?.meta ?? {}), pathParams: [param0] },
|
|
61
63
|
});
|
|
62
64
|
}
|
|
63
65
|
|