config(vite): 配置服务器监听所有网络接口

- 设置 server.host 为 '0.0.0.0' 以允许外部访问
- 注释掉 API 代理配置避免请求转发冲突
This commit is contained in:
2026-05-07 19:02:26 +08:00
parent 300cd863d7
commit 8c0dca0dad
+11 -10
View File
@@ -30,14 +30,15 @@ export default defineConfig({
'@': fileURLToPath(new URL('./src', import.meta.url)) '@': fileURLToPath(new URL('./src', import.meta.url))
}, },
}, },
// server: { server: {
// proxy: { host: '0.0.0.0',
// '/api': { // proxy: {
// target: 'http://127.0.0.1:5000', // '/api': {
// changeOrigin: true, // target: 'http://127.0.0.1:5000',
// // rewrite: (path) => path.replace(/^\/api/, '') // changeOrigin: true,
// // 关键:确保代理不会缓冲响应 // // rewrite: (path) => path.replace(/^\/api/, '')
// } // // 关键:确保代理不会缓冲响应
// } // }
// }, // }
}
}) })