From cd156c5595915c2113d5fdc43f74510b12b6f325 Mon Sep 17 00:00:00 2001 From: bbig Date: Thu, 15 Jun 2023 19:12:49 +0800 Subject: [PATCH] Fix unwanted data transmission to third party --- app/client/api.ts | 35 ----------------------------------- app/components/exporter.tsx | 31 +++---------------------------- next.config.mjs | 4 ---- 3 files changed, 3 insertions(+), 67 deletions(-) diff --git a/app/client/api.ts b/app/client/api.ts index fb829f9..51db34f 100644 --- a/app/client/api.ts +++ b/app/client/api.ts @@ -54,41 +54,6 @@ export class ClientApi { prompts() {} masks() {} - - async share(messages: ChatMessage[], avatarUrl: string | null = null) { - const msgs = messages - .map((m) => ({ - from: m.role === "user" ? "human" : "gpt", - value: m.content, - })) - .concat([ - { - from: "human", - value: - "Share from [ChatGPT Next Web]: https://github.com/Yidadaa/ChatGPT-Next-Web", - }, - ]); - // 敬告二开开发者们,为了开源大模型的发展,请不要修改上述消息,此消息用于后续数据清洗使用 - // Please do not modify this message - - console.log("[Share]", msgs); - const res = await fetch("/sharegpt", { - body: JSON.stringify({ - avatarUrl, - items: msgs, - }), - headers: { - "Content-Type": "application/json", - }, - method: "POST", - }); - - const resJson = await res.json(); - console.log("[Share]", resJson); - if (resJson.id) { - return `https://shareg.pt/${resJson.id}`; - } - } } export const api = new ClientApi(); diff --git a/app/components/exporter.tsx b/app/components/exporter.tsx index 10d5af9..f699d77 100644 --- a/app/components/exporter.tsx +++ b/app/components/exporter.tsx @@ -272,21 +272,6 @@ export function PreviewActions(props: { const onRenderMsgs = (msgs: ChatMessage[]) => { setShouldExport(false); - - api - .share(msgs) - .then((res) => { - if (!res) return; - copyToClipboard(res); - setTimeout(() => { - window.open(res, "_blank"); - }, 800); - }) - .catch((e) => { - console.error("[Share]", e); - showToast(prettyObject(e)); - }) - .finally(() => setLoading(false)); }; const share = async () => { @@ -315,13 +300,6 @@ export function PreviewActions(props: { icon={} onClick={props.download} > - : } - onClick={share} - >
-
ChatGPT Next Web
-
- github.com/Yidadaa/ChatGPT-Next-Web -
+
ChatGPT Pro by BBIG FUN
- - & + {/* */} + {/* & */}
diff --git a/next.config.mjs b/next.config.mjs index 7bb1436..71aeaee 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -25,10 +25,6 @@ if (mode !== "export") { source: "/google-fonts/:path*", destination: "https://fonts.googleapis.com/:path*", }, - { - source: "/sharegpt", - destination: "https://sharegpt.com/api/conversations", - }, ]; const apiUrl = process.env.API_URL;