From 47449d88985de117513311b643a3aea160518218 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E5=98=89=E6=82=A6?= Date: Mon, 2 Jun 2025 19:39:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 3 ++- pnpm-lock.yaml | 40 +++++++++++++++++++++++++++++++--------- src/routers/index.ts | 2 +- types/import_meta.d.ts | 1 + 4 files changed, 35 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index e4cb728..c73da49 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,6 @@ "vue-router": "4" }, "devDependencies": { - "vite-plugin-svg-icons": "^2.0.1", "@antfu/eslint-config": "^4.13.1", "@changesets/cli": "^2.29.4", "@commitlint/config-conventional": "^19.8.1", @@ -46,11 +45,13 @@ "prettier": "^3.5.3", "sass-embedded": "^1.89.0", "typescript": "~5.8.3", + "typescript-api-pro": "^0.0.7", "unocss": "66.1.2", "unplugin-auto-import": "^19.2.0", "unplugin-vue-components": "^28.5.0", "vite": "^6.3.5", "vite-plugin-env-typed": "^0.0.2", + "vite-plugin-svg-icons": "^2.0.1", "vue-tsc": "^2.2.10" }, "config": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ffd0f2a..a2b231c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -34,7 +34,7 @@ importers: version: 2.9.10(vue@3.5.14(typescript@5.8.3)) hook-fetch: specifier: 1.1.1 - version: 1.1.1(typescript-api-pro@0.0.6) + version: 1.1.1(typescript-api-pro@0.0.7) nprogress: specifier: ^0.2.0 version: 0.2.0 @@ -58,7 +58,7 @@ importers: version: 3.5.14(typescript@5.8.3) vue-element-plus-x: specifier: 1.2.0 - version: 1.2.0(markdown-it@14.1.0)(mermaid@11.6.0)(typescript-api-pro@0.0.6)(typescript@5.8.3) + version: 1.2.0(markdown-it@14.1.0)(mermaid@11.6.0)(typescript-api-pro@0.0.7)(typescript@5.8.3) vue-router: specifier: '4' version: 4.5.1(vue@3.5.14(typescript@5.8.3)) @@ -102,6 +102,9 @@ importers: typescript: specifier: ~5.8.3 version: 5.8.3 + typescript-api-pro: + specifier: ^0.0.7 + version: 0.0.7 unocss: specifier: 66.1.2 version: 66.1.2(postcss@5.2.18)(vite@6.3.5(@types/node@22.15.19)(jiti@2.4.2)(sass-embedded@1.89.0)(yaml@2.8.0))(vue@3.5.14(typescript@5.8.3)) @@ -740,56 +743,67 @@ packages: resolution: {integrity: sha512-46OzWeqEVQyX3N2/QdiU/CMXYDH/lSHpgfBkuhl3igpZiaB3ZIfSjKuOnybFVBQzjsLwkus2mjaESy8H41SzvA==} cpu: [arm] os: [linux] + libc: [glibc] '@rollup/rollup-linux-arm-musleabihf@4.41.0': resolution: {integrity: sha512-lfgW3KtQP4YauqdPpcUZHPcqQXmTmH4nYU0cplNeW583CMkAGjtImw4PKli09NFi2iQgChk4e9erkwlfYem6Lg==} cpu: [arm] os: [linux] + libc: [musl] '@rollup/rollup-linux-arm64-gnu@4.41.0': resolution: {integrity: sha512-nn8mEyzMbdEJzT7cwxgObuwviMx6kPRxzYiOl6o/o+ChQq23gfdlZcUNnt89lPhhz3BYsZ72rp0rxNqBSfqlqw==} cpu: [arm64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-arm64-musl@4.41.0': resolution: {integrity: sha512-l+QK99je2zUKGd31Gh+45c4pGDAqZSuWQiuRFCdHYC2CSiO47qUWsCcenrI6p22hvHZrDje9QjwSMAFL3iwXwQ==} cpu: [arm64] os: [linux] + libc: [musl] '@rollup/rollup-linux-loongarch64-gnu@4.41.0': resolution: {integrity: sha512-WbnJaxPv1gPIm6S8O/Wg+wfE/OzGSXlBMbOe4ie+zMyykMOeqmgD1BhPxZQuDqwUN+0T/xOFtL2RUWBspnZj3w==} cpu: [loong64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-powerpc64le-gnu@4.41.0': resolution: {integrity: sha512-eRDWR5t67/b2g8Q/S8XPi0YdbKcCs4WQ8vklNnUYLaSWF+Cbv2axZsp4jni6/j7eKvMLYCYdcsv8dcU+a6QNFg==} cpu: [ppc64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-riscv64-gnu@4.41.0': resolution: {integrity: sha512-TWrZb6GF5jsEKG7T1IHwlLMDRy2f3DPqYldmIhnA2DVqvvhY2Ai184vZGgahRrg8k9UBWoSlHv+suRfTN7Ua4A==} cpu: [riscv64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-riscv64-musl@4.41.0': resolution: {integrity: sha512-ieQljaZKuJpmWvd8gW87ZmSFwid6AxMDk5bhONJ57U8zT77zpZ/TPKkU9HpnnFrM4zsgr4kiGuzbIbZTGi7u9A==} cpu: [riscv64] os: [linux] + libc: [musl] '@rollup/rollup-linux-s390x-gnu@4.41.0': resolution: {integrity: sha512-/L3pW48SxrWAlVsKCN0dGLB2bi8Nv8pr5S5ocSM+S0XCn5RCVCXqi8GVtHFsOBBCSeR+u9brV2zno5+mg3S4Aw==} cpu: [s390x] os: [linux] + libc: [glibc] '@rollup/rollup-linux-x64-gnu@4.41.0': resolution: {integrity: sha512-XMLeKjyH8NsEDCRptf6LO8lJk23o9wvB+dJwcXMaH6ZQbbkHu2dbGIUindbMtRN6ux1xKi16iXWu6q9mu7gDhQ==} cpu: [x64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-x64-musl@4.41.0': resolution: {integrity: sha512-m/P7LycHZTvSQeXhFmgmdqEiTqSV80zn6xHaQ1JSqwCtD1YGtwEK515Qmy9DcB2HK4dOUVypQxvhVSy06cJPEg==} cpu: [x64] os: [linux] + libc: [musl] '@rollup/rollup-win32-arm64-msvc@4.41.0': resolution: {integrity: sha512-4yodtcOrFHpbomJGVEqZ8fzD4kfBeCbpsUy5Pqk4RluXOdsWdjLnjhiKy2w3qzcASWd04fp52Xz7JKarVJ5BTg==} @@ -1128,41 +1142,49 @@ packages: resolution: {integrity: sha512-jon9M7DKRLGZ9VYSkFMflvNqu9hDtOCEnO2QAryFWgT6o6AXU8du56V7YqnaLKr6rAbZBWYsYpikF226v423QA==} cpu: [arm64] os: [linux] + libc: [glibc] '@unrs/resolver-binding-linux-arm64-musl@1.7.2': resolution: {integrity: sha512-c8Cg4/h+kQ63pL43wBNaVMmOjXI/X62wQmru51qjfTvI7kmCy5uHTJvK/9LrF0G8Jdx8r34d019P1DVJmhXQpA==} cpu: [arm64] os: [linux] + libc: [musl] '@unrs/resolver-binding-linux-ppc64-gnu@1.7.2': resolution: {integrity: sha512-A+lcwRFyrjeJmv3JJvhz5NbcCkLQL6Mk16kHTNm6/aGNc4FwPHPE4DR9DwuCvCnVHvF5IAd9U4VIs/VvVir5lg==} cpu: [ppc64] os: [linux] + libc: [glibc] '@unrs/resolver-binding-linux-riscv64-gnu@1.7.2': resolution: {integrity: sha512-hQQ4TJQrSQW8JlPm7tRpXN8OCNP9ez7PajJNjRD1ZTHQAy685OYqPrKjfaMw/8LiHCt8AZ74rfUVHP9vn0N69Q==} cpu: [riscv64] os: [linux] + libc: [glibc] '@unrs/resolver-binding-linux-riscv64-musl@1.7.2': resolution: {integrity: sha512-NoAGbiqrxtY8kVooZ24i70CjLDlUFI7nDj3I9y54U94p+3kPxwd2L692YsdLa+cqQ0VoqMWoehDFp21PKRUoIQ==} cpu: [riscv64] os: [linux] + libc: [musl] '@unrs/resolver-binding-linux-s390x-gnu@1.7.2': resolution: {integrity: sha512-KaZByo8xuQZbUhhreBTW+yUnOIHUsv04P8lKjQ5otiGoSJ17ISGYArc+4vKdLEpGaLbemGzr4ZeUbYQQsLWFjA==} cpu: [s390x] os: [linux] + libc: [glibc] '@unrs/resolver-binding-linux-x64-gnu@1.7.2': resolution: {integrity: sha512-dEidzJDubxxhUCBJ/SHSMJD/9q7JkyfBMT77Px1npl4xpg9t0POLvnWywSk66BgZS/b2Hy9Y1yFaoMTFJUe9yg==} cpu: [x64] os: [linux] + libc: [glibc] '@unrs/resolver-binding-linux-x64-musl@1.7.2': resolution: {integrity: sha512-RvP+Ux3wDjmnZDT4XWFfNBRVG0fMsc+yVzNFUqOflnDfZ9OYujv6nkh+GOr+watwrW4wdp6ASfG/e7bkDradsw==} cpu: [x64] os: [linux] + libc: [musl] '@unrs/resolver-binding-wasm32-wasi@1.7.2': resolution: {integrity: sha512-y797JBmO9IsvXVRCKDXOxjyAE4+CcZpla2GSoBQ33TVb3ILXuFnMrbR/QQZoauBYeOFuu4w3ifWLw52sdHGz6g==} @@ -4358,8 +4380,8 @@ packages: resolution: {integrity: sha512-q7QNVDGTdl702bVFiI5eY4l/HkgCM6at9KhcFbgUAzezHFbOVy4+0O/lCjsABEQwbZPravVfBIiBVGo89yzHFg==} engines: {node: '>= 0.4'} - typescript-api-pro@0.0.6: - resolution: {integrity: sha512-wRA64AFESZkwyqukGgQJAbzF1E77CCYbydy74TwtQ5QopcXql6DsY00E1aCsCSkdH+NyEwOJsb8L5UoaRvndgg==} + typescript-api-pro@0.0.7: + resolution: {integrity: sha512-lCdArKa/rbJptU+ea+Ry+oLz+JgQucYAefO3GXNQuZPIUsW9iAC6OpC3bfQ/8bEmwO2HK6AWj98LoiDMtd6AoA==} typescript@5.8.3: resolution: {integrity: sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==} @@ -7675,11 +7697,11 @@ snapshots: he@1.2.0: {} - hook-fetch@1.1.1(typescript-api-pro@0.0.6): + hook-fetch@1.1.1(typescript-api-pro@0.0.7): dependencies: qs: 6.14.0 radash: 12.1.0 - typescript-api-pro: 0.0.6 + typescript-api-pro: 0.0.7 hookable@5.5.3: {} @@ -9557,7 +9579,7 @@ snapshots: typed-array-buffer: 1.0.3 typed-array-byte-offset: 1.0.4 - typescript-api-pro@0.0.6: {} + typescript-api-pro@0.0.7: {} typescript@5.8.3: {} @@ -9839,7 +9861,7 @@ snapshots: dependencies: vue: 3.5.14(typescript@5.8.3) - vue-element-plus-x@1.2.0(markdown-it@14.1.0)(mermaid@11.6.0)(typescript-api-pro@0.0.6)(typescript@5.8.3): + vue-element-plus-x@1.2.0(markdown-it@14.1.0)(mermaid@11.6.0)(typescript-api-pro@0.0.7)(typescript@5.8.3): dependencies: '@element-plus/icons-vue': 2.3.1(vue@3.5.14(typescript@5.8.3)) '@jsonlee_12138/markdown-it-mermaid': 0.0.6(markdown-it@14.1.0)(mermaid@11.6.0) @@ -9849,7 +9871,7 @@ snapshots: github-markdown-css: 5.8.1 prismjs: 1.30.0 radash: 12.1.0 - typescript-api-pro: 0.0.6 + typescript-api-pro: 0.0.7 vue: 3.5.14(typescript@5.8.3) transitivePeerDependencies: - '@vue/composition-api' diff --git a/src/routers/index.ts b/src/routers/index.ts index 7d0f06a..7756559 100644 --- a/src/routers/index.ts +++ b/src/routers/index.ts @@ -37,7 +37,7 @@ router.beforeEach( start(); // 2、标题 - document.title = to.meta.title || import.meta.env.VITE_WEB_TITLE; + document.title = (to.meta.title as string) || (import.meta.env.VITE_WEB_TITLE as string); // 3、权限 预留 // 3、判断是访问登陆页,有Token访问当前页面,token过期访问接口,axios封装则自动跳转登录页面,没有Token重置路由到登陆页。 diff --git a/types/import_meta.d.ts b/types/import_meta.d.ts index 7ac8836..06bff7e 100644 --- a/types/import_meta.d.ts +++ b/types/import_meta.d.ts @@ -5,6 +5,7 @@ interface ImportMetaEnv { readonly VITE_WEB_TITLE_EN: string; readonly VITE_WEB_ENV: string; readonly VITE_WEB_BASE_API: string; + readonly VITE_BUILD_COMPRESS: string; readonly VITE_API_URL: string; }