config(vite): 配置服务器监听所有网络接口
- 设置 server.host 为 '0.0.0.0' 以允许外部访问 - 注释掉 API 代理配置避免请求转发冲突
This commit is contained in:
@@ -30,7 +30,8 @@ export default defineConfig({
|
|||||||
'@': fileURLToPath(new URL('./src', import.meta.url))
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// server: {
|
server: {
|
||||||
|
host: '0.0.0.0',
|
||||||
// proxy: {
|
// proxy: {
|
||||||
// '/api': {
|
// '/api': {
|
||||||
// target: 'http://127.0.0.1:5000',
|
// target: 'http://127.0.0.1:5000',
|
||||||
@@ -39,5 +40,5 @@ export default defineConfig({
|
|||||||
// // 关键:确保代理不会缓冲响应
|
// // 关键:确保代理不会缓冲响应
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// },
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user