初始版本提交
This commit is contained in:
25
src/api/chatgpt/index.ts
Normal file
25
src/api/chatgpt/index.ts
Normal file
@ -0,0 +1,25 @@
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
|
||||
import { ErrorMessageMode } from '/#/axios';
|
||||
|
||||
enum Api {
|
||||
Send = '/system/demo/test-chatgpt',
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 发送
|
||||
*/
|
||||
export async function sendChatGpt(text: string, mode: ErrorMessageMode = 'modal') {
|
||||
return defHttp.get<string>(
|
||||
{
|
||||
url: Api.Send,
|
||||
params: {
|
||||
text: text,
|
||||
},
|
||||
timeout: 30000,
|
||||
},
|
||||
{
|
||||
errorMessageMode: mode,
|
||||
},
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user