From b758c6e84d2ce82c0da3ee53c7afd021c44d1d36 Mon Sep 17 00:00:00 2001 From: coolxitech Date: Sat, 13 Dec 2025 14:19:10 +0800 Subject: [PATCH] =?UTF-8?q?fix(server):=20=E4=BF=AE=E5=A4=8D=E9=9D=99?= =?UTF-8?q?=E6=80=81=E8=B5=84=E6=BA=90=E6=8B=A6=E6=88=AA=E5=99=A8=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=E5=8C=B9=E9=85=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改路由参数匹配模式,支持更灵活的路径处理 - 确保默认路径正确映射到 index.html - 优化路径解析逻辑,提高静态资源访问准确性 --- server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server.js b/server.js index 8779608..226cb39 100644 --- a/server.js +++ b/server.js @@ -27,7 +27,7 @@ function getLocalIp() { } // 3. 核心:静态资源拦截器(实现单文件嵌入的关键) -app.get('/*', async (req, res) => { +app.get('/:path*', async (req, res) => { // 处理请求路径,默认为 index.html let reqPath = req.path === '/' ? '/index.html' : req.path;