From 6133eba161225c7bf6e8a80cbb2afb5d98e59183 Mon Sep 17 00:00:00 2001 From: wangdan-fit2cloud Date: Fri, 4 Dec 2026 18:26:38 +0800 Subject: [PATCH] fix: config url --- ui/README.md | 7 ++++--- ui/vite.config.ts | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ui/README.md b/ui/README.md index 7d344b70cd0..fc1c3467fdf 100644 --- a/ui/README.md +++ b/ui/README.md @@ -33,11 +33,12 @@ Admin 地址为 `http://localhost:3000/admin/`;另开终端运行 `npm run cha | `VITE_ENTRY` | `admin.html` | `chat.html` | HTML 入口 | | `VITE_API_TARGET` | 未设置 | 未设置 | 覆盖开发代理的后端地址 | -当前未设置 `VITE_API_TARGET` 时,使用 `vite.config.ts` 中的 `defaultBackendTarget`, -值为 `https://mkv3-ee.fit2cloud.cn/`。连接本地后端时,在 `env/.env.local` 中配置: +未设置 `VITE_API_TARGET` 时,开发代理使用 `vite.config.ts` 中的 `defaultBackendTarget` +(`http://127.0.0.1:8080/`)。需要连接其他后端时,在 Git 已忽略的本地覆盖文件中设置, +例如在 `env/.env.local` 中配置本地端口: ```dotenv -VITE_API_TARGET=http://127.0.0.1:8080 +VITE_API_TARGET=http://127.0.0.1:8081 ``` 开发代理覆盖 `/admin/api`、`/chat/api`、`/doc`、`/schema`、`/static` 和当前应用基础路径下的 diff --git a/ui/vite.config.ts b/ui/vite.config.ts index 5a018f928fa..a0a5f286357 100644 --- a/ui/vite.config.ts +++ b/ui/vite.config.ts @@ -9,7 +9,7 @@ import { defineConfig, loadEnv } from 'vite' import type { Plugin, ProxyOptions, ViteDevServer } from 'vite' const envDir = './env' -const defaultBackendTarget = 'https://mkv3-ee.fit2cloud.cn/' +const defaultBackendTarget = 'http://127.0.0.1:8080/' const projectRoot = fileURLToPath(new URL('.', import.meta.url)) const renameHtmlPlugin = (outDir: string, entry: string) => {