From 10a9d8fd595c282a95c85fedf202ad9cf4517dcd Mon Sep 17 00:00:00 2001 From: dolphin <78075021@qq.com> Date: Fri, 28 Jun 2024 19:24:40 +0800 Subject: [PATCH] feat: vite config --- src/frontend/src/components/bs-comp/sheets/SkillSheet.tsx | 2 +- src/frontend/src/components/bs-comp/sheets/ToolsSheet.tsx | 2 +- src/frontend/src/pages/ModelPage/index.tsx | 2 +- src/frontend/vite.config.ts | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/frontend/src/components/bs-comp/sheets/SkillSheet.tsx b/src/frontend/src/components/bs-comp/sheets/SkillSheet.tsx index ad445a002..28960e679 100644 --- a/src/frontend/src/components/bs-comp/sheets/SkillSheet.tsx +++ b/src/frontend/src/components/bs-comp/sheets/SkillSheet.tsx @@ -32,7 +32,7 @@ export default function SkillSheet({ select, children, onSelect }) { }; const toCreateFlow = () => { - window.open("/build/skills"); + window.open(__APP_ENV__.BASE_URL + "/build/skills"); }; const { t } = useTranslation() diff --git a/src/frontend/src/components/bs-comp/sheets/ToolsSheet.tsx b/src/frontend/src/components/bs-comp/sheets/ToolsSheet.tsx index 34aeec978..03e5648e3 100644 --- a/src/frontend/src/components/bs-comp/sheets/ToolsSheet.tsx +++ b/src/frontend/src/components/bs-comp/sheets/ToolsSheet.tsx @@ -42,7 +42,7 @@ export default function ToolsSheet({ select, onSelect, children }) { setKeyword(e.target.value)} /> diff --git a/src/frontend/src/pages/ModelPage/index.tsx b/src/frontend/src/pages/ModelPage/index.tsx index 612d82d12..edf95d3d3 100644 --- a/src/frontend/src/pages/ModelPage/index.tsx +++ b/src/frontend/src/pages/ModelPage/index.tsx @@ -93,7 +93,7 @@ function ConfigModal({ data, readonly, open, setOpen, onSave }) {
- +
diff --git a/src/frontend/vite.config.ts b/src/frontend/vite.config.ts index edad03d12..d6219ac53 100644 --- a/src/frontend/vite.config.ts +++ b/src/frontend/vite.config.ts @@ -6,7 +6,7 @@ import { viteStaticCopy } from 'vite-plugin-static-copy'; import svgr from "vite-plugin-svgr"; // Use environment variable to determine the target. -const target = process.env.VITE_PROXY_TARGET || "http://192.168.106.120:3002"; +const target = process.env.VITE_PROXY_TARGET || "http://127.0.0.1:7861"; const apiRoutes = ["^/api/", "/health"]; const proxyTargets = apiRoutes.reduce((proxyObj, route) => { @@ -46,7 +46,7 @@ proxyTargets['/custom_base/api'] = { * 开启后一般外层网管匹配【custom】时直接透传转到内层网关 * 内层网关访问 api或者前端静态资源需要去掉【custom】前缀 */ -// const app_env = { BASE_URL: '/custom' } +// const app_env = { BASE_URL: '/custom_base' } const app_env = { BASE_URL: '' } export default defineConfig(() => {