feat: 前后端统一接口类型

This commit is contained in:
ChenZhaoYu
2023-02-13 15:54:17 +08:00
parent dd522eb404
commit 847623e22a
12 changed files with 167 additions and 78 deletions

14
src/api/index.ts Normal file
View 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',
})
}