fix: 修复生产模式静态文件路径 build->dist

This commit is contained in:
2026-03-20 13:47:00 +08:00
parent 524f0a6eb1
commit 0648a71560

View File

@@ -352,14 +352,14 @@ async function startServer() {
if (isDev) { if (isDev) {
app.use(express.static(path.join(__dirname, '../dist'))); app.use(express.static(path.join(__dirname, '../dist')));
} else { } else {
app.use(express.static(path.join(__dirname, '../build'))); app.use(express.static(path.join(__dirname, '../dist')));
} }
app.use((req, res) => { app.use((req, res) => {
if (isDev) { if (isDev) {
res.sendFile(path.join(__dirname, '../dist/index.html')); res.sendFile(path.join(__dirname, '../dist/index.html'));
} else { } else {
res.sendFile(path.join(__dirname, '../build/index.html')); res.sendFile(path.join(__dirname, '../dist/index.html'));
} }
}); });