fix(web): configure development proxy and update port documentation (#5)

This commit is contained in:
BBQ
2026-01-29 15:20:48 -08:00
committed by GitHub
parent 8f3ee7582c
commit e5f32bc7e0
4 changed files with 17 additions and 3 deletions
+1 -1
View File
@@ -13,7 +13,7 @@
- `QDRANT_URL` - Qdrant 连接字符串(默认:http://localhost:6333
- `REDIS_URL` - Redis 连接字符串(默认:redis://localhost:6379
- `API_PORT` - API 服务端口(默认:7002
- `API_PORT` - API 服务端口(默认:8080
## 模型配置
+1 -1
View File
@@ -71,7 +71,7 @@ pnpm run db:push
pnpm run api:dev
```
API 服务将在 `http://localhost:7002` 启动。
API 服务将在 `http://localhost:8080` 启动。
## 下一步
+1 -1
View File
@@ -4,7 +4,7 @@ import { useRouter } from 'vue-router'
const router=useRouter()
export default (function () {
const axiosInstance = axios.create({
baseURL:'http://localhost:7002/'
baseURL: '/api'
})
axiosInstance.interceptors.response.use((response) => {
+14
View File
@@ -16,10 +16,24 @@ export default defineConfig({
server: {
port,
host: '0.0.0.0',
proxy: {
"/api": {
target: "http://localhost:8080",
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, "")
}
},
},
preview: {
port,
host: '0.0.0.0',
proxy: {
"/api": {
target: "http://localhost:8080",
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, "")
}
},
allowedHosts: true,
},
resolve: {