From 060a39312d6697db87b328230e121e04d65b59fe Mon Sep 17 00:00:00 2001 From: allence Date: Tue, 6 Jun 2023 17:06:47 +0800 Subject: [PATCH] fix(web): update laf ai request url (#1223) --- web/src/components/ChargeButton/index.tsx | 1 - web/src/constants/index.ts | 2 ++ web/src/pages/app/functions/mods/AIChatPanel/index.tsx | 3 ++- .../functions/mods/FunctionPanel/CreateModal/PromptModal.tsx | 4 ++-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/web/src/components/ChargeButton/index.tsx b/web/src/components/ChargeButton/index.tsx index 009930df56..557e011e6b 100644 --- a/web/src/components/ChargeButton/index.tsx +++ b/web/src/components/ChargeButton/index.tsx @@ -90,7 +90,6 @@ export default function ChargeButton(props: { amount?: number; children: React.R variant={"outline"} key={item} onClick={() => { - console.log(123, item); setAmount(item / 100); }} > diff --git a/web/src/constants/index.ts b/web/src/constants/index.ts index 2248f62a8b..3098de4ad9 100644 --- a/web/src/constants/index.ts +++ b/web/src/constants/index.ts @@ -73,3 +73,5 @@ export const COLOR_MODE = { light: "light", dark: "dark", }; + +export const LAF_AI_URL = "https://htr4n1.laf.run/laf-gpt"; diff --git a/web/src/pages/app/functions/mods/AIChatPanel/index.tsx b/web/src/pages/app/functions/mods/AIChatPanel/index.tsx index 0bc6987e0c..946be849e6 100644 --- a/web/src/pages/app/functions/mods/AIChatPanel/index.tsx +++ b/web/src/pages/app/functions/mods/AIChatPanel/index.tsx @@ -8,6 +8,7 @@ import { v4 as uuidv4 } from "uuid"; import { LafAILogoIcon } from "@/components/CommonIcon"; import Markdown from "@/components/Markdown"; +import { LAF_AI_URL } from "@/constants"; export default function AIChatPanel() { const { t } = useTranslation(); @@ -75,7 +76,7 @@ export default function AIChatPanel() { const { data: generateCodeRes, ...generateCode } = useMutation((params: any) => { inputRef.current?.focus(); return axios({ - url: "https://itceb8.laf.run/laf-gpt", + url: LAF_AI_URL, method: "POST", data: params, cancelToken: source.token, diff --git a/web/src/pages/app/functions/mods/FunctionPanel/CreateModal/PromptModal.tsx b/web/src/pages/app/functions/mods/FunctionPanel/CreateModal/PromptModal.tsx index 12acb4e234..dd6a1c089a 100644 --- a/web/src/pages/app/functions/mods/FunctionPanel/CreateModal/PromptModal.tsx +++ b/web/src/pages/app/functions/mods/FunctionPanel/CreateModal/PromptModal.tsx @@ -30,7 +30,7 @@ import axios from "axios"; import CodeViewer from "@/components/Editor/CodeViewer"; // import FunctionEditor from "@/components/Editor/FunctionEditor"; import InputTag from "@/components/InputTag"; -import { SUPPORTED_METHODS } from "@/constants"; +import { LAF_AI_URL, SUPPORTED_METHODS } from "@/constants"; import { useCreateFunctionMutation, useUpdateFunctionMutation } from "../../../service"; import useFunctionStore from "../../../store"; @@ -59,7 +59,7 @@ const PromptModal = (props: { const { data: generateCodeRes, ...generateCode } = useMutation((params: any) => { return axios({ - url: "https://itceb8.laf.run/laf-gpt", + url: LAF_AI_URL, method: "POST", data: params, cancelToken: source.token,