修改省局的端口的判断为51707

This commit is contained in:
2025-11-07 11:12:43 +08:00
parent 855d74b979
commit 6c09285ac9
4 changed files with 17 additions and 16 deletions
+6 -6
View File
@@ -109,9 +109,9 @@ export async function loader({ request }: LoaderFunctionArgs) {
return redirect("/");
}
// 检查5178端口访问控制
// 检查51707端口访问控制
// 由于应用直接运行在5178端口,我们需要从环境变量或运行时获取端口
// 由于应用直接运行在51707端口,我们需要从环境变量或运行时获取端口
const currentPort = process.env.PORT || process.env.API_PORT_CONFIG;
// console.log("currentPort-----------",currentPort)
@@ -119,17 +119,17 @@ export async function loader({ request }: LoaderFunctionArgs) {
const runtimePort = url.port || currentPort;
// console.log("runtimePort-----------",runtimePort)
const isPort51708 = currentPort === '5178' || runtimePort === '5178';
const isPort51707 = currentPort === '51707' || runtimePort === '51707';
if (isPort51708 && !isPublicPath) {
// 51708端口只允许访问交叉评查相关路径和首页
if (isPort51707 && !isPublicPath) {
// 51707端口(省局)只允许访问交叉评查相关路径和首页
const allowedPaths = ['/', '/cross-checking','/chat-with-llm'];
const isAllowedPath = allowedPaths.some(path => pathname === path) ||
pathname.startsWith('/cross-checking/') ||
pathname.startsWith('/chat-with-llm/');
if (!isAllowedPath) {
// console.log("5178端口访问受限,重定向到交叉评查页面");
// console.log("51707端口访问受限,重定向到交叉评查页面");
return redirect("/cross-checking");
}
}