refactor: 前端 WebSocket 地址改为动态推导,添加 Vite 开发代理
- websocket.ts: 移除硬编码 localhost:8080,基于 window.location 动态构建 WS URL - vite.config.ts: 添加 /ws 和 /api 的 server.proxy 配置 - 同步更新 02-系统架构.md 和 03-接口文档.md 中的开发环境说明
This commit is contained in:
@@ -15,6 +15,17 @@ const staticFiles = [
|
||||
]
|
||||
|
||||
export default defineConfig({
|
||||
server: {
|
||||
proxy: {
|
||||
'/ws': {
|
||||
target: 'http://localhost:8080',
|
||||
ws: true,
|
||||
},
|
||||
'/api': {
|
||||
target: 'http://localhost:8080',
|
||||
},
|
||||
},
|
||||
},
|
||||
plugins: [
|
||||
react(),
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user