mirror of
https://github.com/Chanzhaoyu/chatgpt-web.git
synced 2025-07-23 22:34:44 +00:00
feat: 前后端统一接口类型
This commit is contained in:
14
src/api/index.ts
Normal file
14
src/api/index.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { post } from '@/utils/request'
|
||||
|
||||
export function fetchChatAPI<T = any>(prompt: string) {
|
||||
return post<T>({
|
||||
url: '/chat',
|
||||
data: { prompt },
|
||||
})
|
||||
}
|
||||
|
||||
export function clearConversations<T = any>() {
|
||||
return post<T>({
|
||||
url: '/clear',
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user