From 0f2ea7c1bf1e42639195b444512cb863a18dc53a Mon Sep 17 00:00:00 2001 From: zjn225 <740627396@qq.com> Date: Fri, 31 Mar 2023 17:58:31 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 4 ++++ app/components/home.tsx | 11 +++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6f7547b21..91e433982 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,6 +15,8 @@ FROM base AS builder RUN apk update && apk add --no-cache git ENV OPENAI_API_KEY="" +ENV APPLY_URL="" +ENV API_URL="" ENV CODE="" ARG DOCKER=true @@ -28,6 +30,8 @@ FROM base AS runner WORKDIR /app ENV OPENAI_API_KEY="" +ENV APPLY_URL="" +ENV API_URL="" ENV CODE="" COPY --from=builder /app/public ./public diff --git a/app/components/home.tsx b/app/components/home.tsx index 3b49b542c..f3c76b397 100644 --- a/app/components/home.tsx +++ b/app/components/home.tsx @@ -613,12 +613,12 @@ export function Home() { useEffect(() => { const urlParams = new URLSearchParams(window.location.search); const signature = urlParams.get("signature"); - // 不是企业微信环境,拦截 - fetch(`//192.168.5.198/api/check_user_white/?signature=${signature}`) + // 是否在白名单 + fetch(`${process.env.API_URL}/api/check_user_white/?signature=${signature}`) .then((response) => response.json()) .then((data) => { const { code, msg } = data; - setIsAllow(code === 0); // 是否在白名单 + setIsAllow(code === 0); }) .catch((error) => console.error(error)); }, []); @@ -644,8 +644,7 @@ export function Home() { } const goApply = () => { - location.href = - "http://work-order.zhiketong.net/#/process/create-ticket?processId=117"; + location.href = `${process.env.APPLY_URL}/#/process/create-ticket?processId=117`; }; return ( @@ -656,7 +655,7 @@ export function Home() { : styles.container }`} > - {!isWorkWechat() ? ( + {isWorkWechat() ? (

请在企业微信里使用Gpt~

) : typeof isAllow === "boolean" && !isAllow ? (