From ab98000ab121215183f072ac3ae095807c2026a8 Mon Sep 17 00:00:00 2001 From: zhanghao <774378400@qq.com> Date: Mon, 29 Jun 2026 17:33:18 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20express=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/index.js b/server/index.js index e8b0cf4..9c2e75e 100644 --- a/server/index.js +++ b/server/index.js @@ -253,11 +253,11 @@ if (isProd) { app.use(express.static(distPath)); // SPA 回退:所有非 API 请求返回 index.html - app.get('*', (req, res) => { + app.get('/{*path}', (req, res) => { res.sendFile(path.resolve(distPath, 'index.html')); }); - app.post('*', (req, res) => { + app.post('/{*path}', (req, res) => { res.sendFile(path.resolve(distPath, 'index.html')); }); }