mirror of
https://github.com/jackhh66/ChatGPT_Web_accessToken.git
synced 2026-12-03 20:59:33 +00:00
feat: 侧边栏切换取消上次请求
This commit is contained in:
1 parent
d2ae2c4f54
commit
4458e744cc
4 files changed
+40
-24
No files matched your search
+5
-6
@@ -1,17 +1,16 @@
|
||||
import type { GenericAbortSignal } from 'axios'
|
||||
import { post } from '@/utils/request'
|
||||
|
||||
export const controller = new AbortController()
|
||||
|
||||
export function fetchChatAPI<T = any>(
|
||||
prompt: string,
|
||||
options?: { conversationId?: string; parentMessageId?: string },
|
||||
signal?: GenericAbortSignal,
|
||||
) {
|
||||
return post<T>({
|
||||
url: '/chat',
|
||||
data: { prompt, options },
|
||||
})
|
||||
}
|
||||
|
||||
export function clearConversations<T = any>() {
|
||||
return post<T>({
|
||||
url: '/clear',
|
||||
signal,
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user