From a8c5392616393b48cc8c4945cf56a786cbeb4695 Mon Sep 17 00:00:00 2001 From: 14790897 <14790897abc@gmail.com> Date: Sat, 11 May 2024 08:39:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A6=82=E6=9E=9Capi=E6=98=AF=E6=97=A7?= =?UTF-8?q?=E5=9F=9F=E5=90=8D=E5=B0=B1=E6=94=B9=E4=B8=BA=E6=96=B0=E5=9F=9F?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/QuillEditor.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/components/QuillEditor.tsx b/components/QuillEditor.tsx index 7f7a1d9..3ac5399 100644 --- a/components/QuillEditor.tsx +++ b/components/QuillEditor.tsx @@ -1,6 +1,6 @@ "use client"; -import React, { useState, useEffect, useRef } from "react"; +import React, { useState, useEffect, useRef, use } from "react"; import Quill from "quill"; import "quill/dist/quill.snow.css"; import { useLocalStorage } from "react-use"; @@ -253,6 +253,14 @@ const QEditor = ({ lng }) => { // dispatch(setApiKey("sk-GHuPUV6ERD8wVmmr36FeB8D809D34d93Bb857c009f6aF9Fe")); // dispatch(setUpsreamUrl("https://one.paperai.life")); // }); + useEffect(() => { + if (upsreamUrl === "https://one.liuweiqing.top") { + dispatch( + setApiKey("sk-GHuPUV6ERD8wVmmr36FeB8D809D34d93Bb857c009f6aF9Fe") + ); + dispatch(setUpsreamUrl("https://one.paperai.life")); + } + }, [upsreamUrl]); const handleTextChange = debounce(async function (delta, oldDelta, source) { if (source === "user") { // 获取编辑器内容