feat: express调整

This commit is contained in:
zhanghao 2026-06-29 17:33:18 +08:00
parent daac931994
commit ab98000ab1

View File

@ -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'));
});
}