From 5f442e0ed9d0bbc004826cc59d9b6c730c50537f Mon Sep 17 00:00:00 2001 From: feige996 <1020102647@qq.com> Date: Fri, 15 Aug 2025 09:57:18 +0800 Subject: [PATCH] =?UTF-8?q?fix(h5):=20=E8=AE=BE=E7=BD=AE=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=E5=9F=BA=E7=A1=80=E8=B7=AF=E5=BE=84=E4=B8=BA=E6=A0=B9=E7=9B=AE?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将h5路由的基础路径配置为根目录,确保部署时路径正确。同时在manifest.json和manifest.config.ts中同步此配置,并更新相关文档链接。 --- env/.env | 1 + manifest.config.ts | 2 +- src/manifest.json | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/env/.env b/env/.env index d9bff94..e235122 100644 --- a/env/.env +++ b/env/.env @@ -5,6 +5,7 @@ VITE_UNI_APPID = '__UNI__D1E5001' VITE_WX_APPID = 'wxa2abb91f64032a2b' # h5部署网站的base,配置到 manifest.config.ts 里的 h5.router.base +# https://uniapp.dcloud.net.cn/collocation/manifest.html#h5-router VITE_APP_PUBLIC_BASE=/ # 登录页面 diff --git a/manifest.config.ts b/manifest.config.ts index 6f3c7d9..ce33f2c 100644 --- a/manifest.config.ts +++ b/manifest.config.ts @@ -30,7 +30,7 @@ export default defineManifestConfig({ 'locale': VITE_FALLBACK_LOCALE, // 'zh-Hans' 'h5': { router: { - // base: VITE_APP_PUBLIC_BASE, + base: VITE_APP_PUBLIC_BASE, }, }, /* 5+App特有相关 */ diff --git a/src/manifest.json b/src/manifest.json index c436de6..b233c23 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -109,6 +109,8 @@ }, "vueVersion": "3", "h5": { - "router": {} + "router": { + "base": "/" + } } } \ No newline at end of file