From b12d348997df21ded6cfab338284886aac8012cf Mon Sep 17 00:00:00 2001 From: Twilight Date: Sat, 14 Sep 2024 19:26:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/settings/AssistantSettings.vue | 77 +++++++++++++++++-- 1 file changed, 71 insertions(+), 6 deletions(-) diff --git a/src/components/settings/AssistantSettings.vue b/src/components/settings/AssistantSettings.vue index 88593a7..29bf164 100644 --- a/src/components/settings/AssistantSettings.vue +++ b/src/components/settings/AssistantSettings.vue @@ -98,11 +98,52 @@
- 助理共享 - - 新建助理 - + 应用对接(原助理共享) + + +
+ API Key 默认是没有请求限制的。为了防止 API Key + 滥用,对外发布时,我们建议您包装一个 UI 界面(比如使用 PHP + 等做一个请求限制),来防止 API Key 滥用。 +
+ 当然,如果您在自己的私有应用中使用,可以忽略此建议。 +
+
+ + + + +
+
+ {{ c.token }} +
+
+ + +
+ 删除后,应用将无法访问此助理。 +
+
+
+
+
+
+
@@ -194,9 +235,8 @@ const showEditAssistant = async (id: number) => { currentAssistantId.value = id; currentAssistant.value = (await getApi().Assistant.apiV1AssistantsIdGet(id)).data.data ?? {}; + await getAssistantsShares(); - assistantShares.value = - (await getApi().Assistant.apiV1AssistantsIdSharesGet(id)).data.data ?? []; getTools(); }; @@ -206,6 +246,7 @@ const editAssistant = async () => { currentAssistant.value ); await getAssistants(); + await getAssistantsShares(); }; const getTools = async () => { @@ -256,6 +297,30 @@ const getAssistants = async () => { (await getApi().Assistant.apiV1AssistantsGet()).data.data ?? []; }; +const getAssistantsShares = async () => { + assistantShares.value = + ( + await getApi().Assistant.apiV1AssistantsIdSharesGet( + currentAssistantId.value + ) + ).data.data ?? []; +}; + +const createAssistantShare = async () => { + await getApi().Assistant.apiV1AssistantsIdSharesPost( + currentAssistantId.value + ); + await getAssistantsShares(); +}; + +const deleteAssistantShare = async (id: number) => { + await getApi().Assistant.apiV1AssistantsIdSharesShareIdDelete( + currentAssistantId.value, + id + ); + await getAssistantsShares(); +}; + getChats(); getLibraries(); getAssistants();