feat: try to add auto updater

This commit is contained in:
Yidadaa
2023-06-15 23:55:18 +08:00
parent 698be6671c
commit 91b871ef3b
6 changed files with 272 additions and 3 deletions

View File

@@ -1,3 +1,4 @@
import { getClientConfig } from "../config/client";
import { ACCESS_CODE_PREFIX } from "../constant";
import { ChatMessage, ModelType, useAccessStore } from "../store";
import { ChatGPTApi } from "./platforms/openai";
@@ -93,7 +94,11 @@ export class ClientApi {
// Please do not modify this message
console.log("[Share]", msgs);
const res = await fetch("/sharegpt", {
const clientConfig = getClientConfig();
const proxyUrl = "/sharegpt";
const rawUrl = "https://sharegpt.com/api/conversations";
const shareUrl = clientConfig?.isApp ? rawUrl : proxyUrl;
const res = await fetch(shareUrl, {
body: JSON.stringify({
avatarUrl,
items: msgs,