更新配置文件和依赖

This commit is contained in:
新用户名 2025-04-26 15:24:05 +08:00
parent 7c1418bc55
commit 310e558cba
5 changed files with 57 additions and 31 deletions

View File

@ -3,8 +3,8 @@ NODE_ENV=production
VITE_DEV=true VITE_DEV=true
# 请求路径 # 请求路径 /adminInspect
VITE_BASE_URL='http://api-dashboard.yudao.iocoder.cn' VITE_BASE_URL='http://localhost:48080'
# 文件上传类型server - 后端上传, client - 前端直连上传仅支持S3服务 # 文件上传类型server - 后端上传, client - 前端直连上传仅支持S3服务
VITE_UPLOAD_TYPE=server VITE_UPLOAD_TYPE=server
@ -21,8 +21,8 @@ VITE_DROP_CONSOLE=false
# 是否sourcemap # 是否sourcemap
VITE_SOURCEMAP=true VITE_SOURCEMAP=true
# 打包路径 # 打包路径 inspect
VITE_BASE_PATH=/ VITE_BASE_PATH=/inspect
# 输出路径 # 输出路径
VITE_OUT_DIR=dist VITE_OUT_DIR=dist

View File

@ -21,8 +21,7 @@ module.exports = defineConfig({
'plugin:vue/vue3-recommended', 'plugin:vue/vue3-recommended',
'plugin:@typescript-eslint/recommended', 'plugin:@typescript-eslint/recommended',
'prettier', 'prettier',
'plugin:prettier/recommended', 'plugin:prettier/recommended'
'@unocss'
], ],
rules: { rules: {
'@typescript-eslint/no-this-alias': 'off', '@typescript-eslint/no-this-alias': 'off',
@ -69,8 +68,6 @@ module.exports = defineConfig({
], ],
'vue/multi-word-component-names': 'off', 'vue/multi-word-component-names': 'off',
'vue/no-v-html': 'off', 'vue/no-v-html': 'off',
'prettier/prettier': 'off', // 芋艿:默认关闭 prettier 的 ESLint 校验,因为我们使用的是 IDE 的 Prettier 插件 'prettier/prettier': 'off'
'@unocss/order': 'off', // 芋艿:禁用 unocss 【css】顺序的提示因为暂时不需要这么严格警告也有点繁琐
'@unocss/order-attributify': 'off' // 芋艿:禁用 unocss 【属性】顺序的提示,因为暂时不需要这么严格,警告也有点繁琐
} }
}) })

View File

@ -10,7 +10,7 @@
"dev-server": "vite --mode dev", "dev-server": "vite --mode dev",
"ts:check": "vue-tsc --noEmit", "ts:check": "vue-tsc --noEmit",
"build:local": "node --max_old_space_size=4096 ./node_modules/vite/bin/vite.js build", "build:local": "node --max_old_space_size=4096 ./node_modules/vite/bin/vite.js build",
"build:dev": "node --max_old_space_size=4096 ./node_modules/vite/bin/vite.js build --mode dev", "build:dev": "node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode dev",
"build:test": "node --max_old_space_size=4096 ./node_modules/vite/bin/vite.js build --mode test", "build:test": "node --max_old_space_size=4096 ./node_modules/vite/bin/vite.js build --mode test",
"build:stage": "node --max_old_space_size=4096 ./node_modules/vite/bin/vite.js build --mode stage", "build:stage": "node --max_old_space_size=4096 ./node_modules/vite/bin/vite.js build --mode stage",
"build:prod": "node --max_old_space_size=4096 ./node_modules/vite/bin/vite.js build --mode prod", "build:prod": "node --max_old_space_size=4096 ./node_modules/vite/bin/vite.js build --mode prod",
@ -67,6 +67,7 @@
"sortablejs": "^1.15.3", "sortablejs": "^1.15.3",
"steady-xml": "^0.1.0", "steady-xml": "^0.1.0",
"url": "^0.11.3", "url": "^0.11.3",
"validator": "^13.15.0",
"video.js": "^7.21.5", "video.js": "^7.21.5",
"viewerjs": "^1.11.7", "viewerjs": "^1.11.7",
"vue": "3.5.12", "vue": "3.5.12",
@ -93,6 +94,7 @@
"@types/nprogress": "^0.2.3", "@types/nprogress": "^0.2.3",
"@types/qrcode": "^1.5.5", "@types/qrcode": "^1.5.5",
"@types/qs": "^6.9.12", "@types/qs": "^6.9.12",
"@types/validator": "^13.15.0",
"@typescript-eslint/eslint-plugin": "^7.1.0", "@typescript-eslint/eslint-plugin": "^7.1.0",
"@typescript-eslint/parser": "^7.1.0", "@typescript-eslint/parser": "^7.1.0",
"@unocss/eslint-config": "^0.57.4", "@unocss/eslint-config": "^0.57.4",

View File

@ -134,6 +134,9 @@ importers:
url: url:
specifier: ^0.11.3 specifier: ^0.11.3
version: 0.11.4 version: 0.11.4
validator:
specifier: ^13.15.0
version: 13.15.0
video.js: video.js:
specifier: ^7.21.5 specifier: ^7.21.5
version: 7.21.6 version: 7.21.6
@ -207,6 +210,9 @@ importers:
'@types/qs': '@types/qs':
specifier: ^6.9.12 specifier: ^6.9.12
version: 6.9.17 version: 6.9.17
'@types/validator':
specifier: ^13.15.0
version: 13.15.0
'@typescript-eslint/eslint-plugin': '@typescript-eslint/eslint-plugin':
specifier: ^7.1.0 specifier: ^7.1.0
version: 7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.3.3))(eslint@8.57.1)(typescript@5.3.3) version: 7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.3.3))(eslint@8.57.1)(typescript@5.3.3)
@ -215,7 +221,7 @@ importers:
version: 7.18.0(eslint@8.57.1)(typescript@5.3.3) version: 7.18.0(eslint@8.57.1)(typescript@5.3.3)
'@unocss/eslint-config': '@unocss/eslint-config':
specifier: ^0.57.4 specifier: ^0.57.4
version: 0.57.7(eslint@8.57.1)(typescript@5.3.3) version: 0.57.4(eslint@8.57.1)(typescript@5.3.3)
'@unocss/transformer-variant-group': '@unocss/transformer-variant-group':
specifier: ^0.58.5 specifier: ^0.58.5
version: 0.58.9 version: 0.58.9
@ -1913,6 +1919,9 @@ packages:
'@types/trusted-types@2.0.7': '@types/trusted-types@2.0.7':
resolution: {integrity: sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==} resolution: {integrity: sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==}
'@types/validator@13.15.0':
resolution: {integrity: sha512-nh7nrWhLr6CBq9ldtw0wx+z9wKnnv/uTVLA9g/3/TcOYxbpOSZE+MhKPmWqU+K0NvThjhv12uD8MuqijB0WzEA==}
'@types/video.js@7.3.58': '@types/video.js@7.3.58':
resolution: {integrity: sha512-1CQjuSrgbv1/dhmcfQ83eVyYbvGyqhTvb2Opxr0QCV+iJ4J6/J+XWQ3Om59WiwCd1MN3rDUHasx5XRrpUtewYQ==} resolution: {integrity: sha512-1CQjuSrgbv1/dhmcfQ83eVyYbvGyqhTvb2Opxr0QCV+iJ4J6/J+XWQ3Om59WiwCd1MN3rDUHasx5XRrpUtewYQ==}
@ -2033,26 +2042,26 @@ packages:
engines: {node: '>=14'} engines: {node: '>=14'}
hasBin: true hasBin: true
'@unocss/config@0.57.7': '@unocss/config@0.57.4':
resolution: {integrity: sha512-UG8G9orWEdk/vyDvGUToXYn/RZy/Qjpx66pLsaf5wQK37hkYsBoReAU5v8Ia/6PL1ueJlkcNXLaNpN6/yVoJvg==} resolution: {integrity: sha512-Si0fA6fb6kLymgWbXvgM50PtX8zKV5p+BMeAn17ihefnasjg0fdPe1Zgdj/QdLJpwIcJ5yOw3uFwVgrOYRqIfQ==}
engines: {node: '>=14'} engines: {node: '>=14'}
'@unocss/config@0.58.9': '@unocss/config@0.58.9':
resolution: {integrity: sha512-90wRXIyGNI8UenWxvHUcH4l4rgq813MsTzYWsf6ZKyLLvkFjV2b2EfGXI27GPvZ7fVE1OAqx+wJNTw8CyQxwag==} resolution: {integrity: sha512-90wRXIyGNI8UenWxvHUcH4l4rgq813MsTzYWsf6ZKyLLvkFjV2b2EfGXI27GPvZ7fVE1OAqx+wJNTw8CyQxwag==}
engines: {node: '>=14'} engines: {node: '>=14'}
'@unocss/core@0.57.7': '@unocss/core@0.57.4':
resolution: {integrity: sha512-1d36M0CV3yC80J0pqOa5rH1BX6g2iZdtKmIb3oSBN4AWnMCSrrJEPBrUikyMq2TEQTrYWJIVDzv5A9hBUat3TA==} resolution: {integrity: sha512-JXufixa501p7+uwUkfG9voIUvNYXv58shZCKXO4Q9AojOzOMu6TDj35x8f3Sv5WFtZ3tp03sIETAfQRo7ksshw==}
'@unocss/core@0.58.9': '@unocss/core@0.58.9':
resolution: {integrity: sha512-wYpPIPPsOIbIoMIDuH8ihehJk5pAZmyFKXIYO/Kro98GEOFhz6lJoLsy6/PZuitlgp2/TSlubUuWGjHWvp5osw==} resolution: {integrity: sha512-wYpPIPPsOIbIoMIDuH8ihehJk5pAZmyFKXIYO/Kro98GEOFhz6lJoLsy6/PZuitlgp2/TSlubUuWGjHWvp5osw==}
'@unocss/eslint-config@0.57.7': '@unocss/eslint-config@0.57.4':
resolution: {integrity: sha512-EJlI6rV0ZfDCphIiddHSWZVeoHdYDTVohVXGo+NfNOuRuvYWGna3n4hY3VEAiT3mWLK0/0anzHF7X0PNzCR5lQ==} resolution: {integrity: sha512-YQqTwVFmPFS2E65ZWA4WI/1c75GAMAmAEDoqItOWOu/Qf7FZZ2Fx15hOygzpdgDnYMbGVXezYz9BYedzJW9ePg==}
engines: {node: '>=14'} engines: {node: '>=14'}
'@unocss/eslint-plugin@0.57.7': '@unocss/eslint-plugin@0.57.4':
resolution: {integrity: sha512-nwj7UJF7wCfPVl5B7cUB0xrSk6yuVMdMgABnsy4N5xBlds8cclrUO+boaTB9qzh8Lg9nfJVLB3+cW3po2SJoew==} resolution: {integrity: sha512-FeaabugemDJaCHrSYtIVL94m5fRZRkE0S65clL2dMAtoBiR0gevxzWXAdwW4OxI93b81tufWF7o+toFvS9E9kA==}
engines: {node: '>=14'} engines: {node: '>=14'}
'@unocss/extractor-arbitrary-variants@0.58.9': '@unocss/extractor-arbitrary-variants@0.58.9':
@ -5643,6 +5652,10 @@ packages:
resolution: {integrity: sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ==} resolution: {integrity: sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ==}
hasBin: true hasBin: true
validator@13.15.0:
resolution: {integrity: sha512-36B2ryl4+oL5QxZ3AzD0t5SsMNGvTtQHpjgFO5tbNxfXbMFkY822ktCDe1MnlqV3301QQI9SLHDNJokDI+Z9pA==}
engines: {node: '>= 0.10'}
vary@1.1.2: vary@1.1.2:
resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==}
engines: {node: '>= 0.8'} engines: {node: '>= 0.8'}
@ -7650,6 +7663,8 @@ snapshots:
'@types/trusted-types@2.0.7': '@types/trusted-types@2.0.7':
optional: true optional: true
'@types/validator@13.15.0': {}
'@types/video.js@7.3.58': {} '@types/video.js@7.3.58': {}
'@types/web-bluetooth@0.0.16': {} '@types/web-bluetooth@0.0.16': {}
@ -7821,9 +7836,9 @@ snapshots:
transitivePeerDependencies: transitivePeerDependencies:
- rollup - rollup
'@unocss/config@0.57.7': '@unocss/config@0.57.4':
dependencies: dependencies:
'@unocss/core': 0.57.7 '@unocss/core': 0.57.4
unconfig: 0.3.13 unconfig: 0.3.13
'@unocss/config@0.58.9': '@unocss/config@0.58.9':
@ -7831,23 +7846,23 @@ snapshots:
'@unocss/core': 0.58.9 '@unocss/core': 0.58.9
unconfig: 0.3.13 unconfig: 0.3.13
'@unocss/core@0.57.7': {} '@unocss/core@0.57.4': {}
'@unocss/core@0.58.9': {} '@unocss/core@0.58.9': {}
'@unocss/eslint-config@0.57.7(eslint@8.57.1)(typescript@5.3.3)': '@unocss/eslint-config@0.57.4(eslint@8.57.1)(typescript@5.3.3)':
dependencies: dependencies:
'@unocss/eslint-plugin': 0.57.7(eslint@8.57.1)(typescript@5.3.3) '@unocss/eslint-plugin': 0.57.4(eslint@8.57.1)(typescript@5.3.3)
transitivePeerDependencies: transitivePeerDependencies:
- eslint - eslint
- supports-color - supports-color
- typescript - typescript
'@unocss/eslint-plugin@0.57.7(eslint@8.57.1)(typescript@5.3.3)': '@unocss/eslint-plugin@0.57.4(eslint@8.57.1)(typescript@5.3.3)':
dependencies: dependencies:
'@typescript-eslint/utils': 6.21.0(eslint@8.57.1)(typescript@5.3.3) '@typescript-eslint/utils': 6.21.0(eslint@8.57.1)(typescript@5.3.3)
'@unocss/config': 0.57.7 '@unocss/config': 0.57.4
'@unocss/core': 0.57.7 '@unocss/core': 0.57.4
magic-string: 0.30.14 magic-string: 0.30.14
synckit: 0.8.8 synckit: 0.8.8
transitivePeerDependencies: transitivePeerDependencies:
@ -11968,6 +11983,8 @@ snapshots:
uuid@10.0.0: {} uuid@10.0.0: {}
validator@13.15.0: {}
vary@1.1.2: {} vary@1.1.2: {}
video.js@7.21.6: video.js@7.21.6:

View File

@ -9,13 +9,19 @@ const { renderMenuTitle } = useRenderMenuTitle()
export const useRenderMenuItem = () => export const useRenderMenuItem = () =>
// allRouters: AppRouteRecordRaw[] = [], // allRouters: AppRouteRecordRaw[] = [],
{ {
const renderMenuItem = (routers: AppRouteRecordRaw[], parentPath = '/') => { const renderMenuItem = (routers: AppRouteRecordRaw[] = [], parentPath = '/') => {
return routers return (routers || [])
.filter((v) => !v.meta?.hidden) .filter((v) => !v.meta?.hidden)
.map((v) => { .map((v) => {
const meta = v.meta ?? {} const meta = v.meta ?? {}
const { oneShowingChild, onlyOneChild } = hasOneShowingChild(v.children, v) const { oneShowingChild, onlyOneChild } = hasOneShowingChild(v.children, v)
const fullPath = isUrl(v.path) ? v.path : pathResolve(parentPath, v.path) // getAllParentPath<AppRouteRecordRaw>(allRouters, v.path).join('/') // 确保 v.path 存在且为字符串
const currentPath = v.path || ''
const fullPath = isUrl(currentPath)
? currentPath
: currentPath.startsWith('/')
? currentPath
: pathResolve(parentPath, currentPath)
if ( if (
oneShowingChild && oneShowingChild &&
@ -24,7 +30,11 @@ export const useRenderMenuItem = () =>
) { ) {
return ( return (
<ElMenuItem <ElMenuItem
index={onlyOneChild ? pathResolve(fullPath, onlyOneChild.path) : fullPath} index={onlyOneChild
? (onlyOneChild.path?.startsWith('/')
? onlyOneChild.path
: pathResolve(fullPath, onlyOneChild.path || ''))
: fullPath}
> >
{{ {{
default: () => renderMenuTitle(onlyOneChild ? onlyOneChild?.meta : meta) default: () => renderMenuTitle(onlyOneChild ? onlyOneChild?.meta : meta)