From d05c3cfa16f8fcfc23bd167d7d475c32a6f83551 Mon Sep 17 00:00:00 2001 From: yorn <1057707203@qq.com> Date: Mon, 8 Dec 2025 09:32:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6dify=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/config/api-config.ts | 14 +++++++------- app/root.tsx | 10 +++++----- vite.config.ts | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/app/config/api-config.ts b/app/config/api-config.ts index 28c04c3..0fcaf46 100644 --- a/app/config/api-config.ts +++ b/app/config/api-config.ts @@ -121,15 +121,15 @@ const portConfigs: Record> = { const configs: Record = { // 开发环境 development: { - baseUrl: 'http://172.16.0.58:8073', // FastAPI后端(包含/dify代理) - documentUrl: 'http://172.16.0.58:8073/docauditai/', - uploadUrl: 'http://172.16.0.58:8073/admin/documents', - // baseUrl: 'http://172.16.0.55:8073', // FastAPI后端(包含/dify代理) - // documentUrl: 'http://172.16.0.55:8073/docauditai/', - // uploadUrl: 'http://172.16.0.55:8073/admin/documents', + // baseUrl: 'http://172.16.0.58:8073', // FastAPI后端(包含/dify代理) + // documentUrl: 'http://172.16.0.58:8073/docauditai/', + // uploadUrl: 'http://172.16.0.58:8073/admin/documents', + baseUrl: 'http://172.16.0.55:8073', // FastAPI后端(包含/dify代理) + documentUrl: 'http://172.16.0.55:8073/docauditai/', + uploadUrl: 'http://172.16.0.55:8073/admin/documents', collaboraUrl: 'http://172.16.0.81:9980', - appUrl: 'http://172.16.0.78:51703', + appUrl: 'http://172.16.0.34:5173', oauth: { serverUrl: 'http://10.79.112.85', // IDaaS服务器地址 diff --git a/app/root.tsx b/app/root.tsx index 6175996..f3d5c20 100644 --- a/app/root.tsx +++ b/app/root.tsx @@ -177,11 +177,11 @@ export async function loader({ request }: LoaderFunctionArgs) { // 检查当前路径是否在允许列表中 const isAllowedPath = isPathAllowed(pathname, allowedPaths); - // if (!isAllowedPath) { - // console.warn(`⚠️ [Root Loader] 用户尝试访问未授权路由: ${pathname}`); - // // 返回 403 错误,而不是 redirect(避免循环) - // throw new Response("无权访问此页面", { status: 403 }); - // } + if (!isAllowedPath) { + console.warn(`⚠️ [Root Loader] 用户尝试访问未授权路由: ${pathname}`); + // 返回 403 错误,而不是 redirect(避免循环) + throw new Response("无权访问此页面", { status: 403 }); + } } else { // 🔑 检查是否因为认证失败需要重定向到登录页 if (routesResult.shouldRedirectToHome) { diff --git a/vite.config.ts b/vite.config.ts index e4062cc..adc9e23 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -53,7 +53,7 @@ export default defineConfig({ server: { host: '0.0.0.0', // port: 5173, - port: Number(process.env.PORT) || 51703, + port: Number(process.env.PORT) || 5173, open: true, // open: false, allowedHosts: ['nas.7bm.co', 'localhost', '127.0.0.1'], // 允许的主机名列表1