mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-28 04:59:52 +01:00
fix: offline.html离线页面路径增加 BASE_URL 前缀,适配子目录部署
之前路径硬编码为绝对路径,导致应用部署在非根目录时出现 404 错误。 现改为动态拼接 process.env.BASE_URL 以支持不同环境的部署路径。
This commit is contained in:
parent
a8c13d740b
commit
ec7efb9ebf
1 changed files with 6 additions and 6 deletions
|
|
@ -41,7 +41,7 @@ workbox.core.skipWaiting();
|
|||
workbox.core.clientsClaim();
|
||||
|
||||
// 预缓存离线页面
|
||||
const OFFLINE_URL = '/offline.html';
|
||||
const OFFLINE_URL = process.env.BASE_URL + 'offline.html';
|
||||
workbox.precaching.precacheAndRoute([
|
||||
{ url: OFFLINE_URL, revision: null }
|
||||
]);
|
||||
|
|
|
|||
Loading…
Reference in a new issue