24 lines
648 B
TypeScript
24 lines
648 B
TypeScript
import request from '@/utils/request';
|
|
import type { AxiosRequestConfig } from 'axios';
|
|
import type { ApiResult } from '@/api';
|
|
import type { ManuscriptGenParams, ManuscriptGenResult } from './model';
|
|
import { MODULES_API_URL } from '@/config/setting';
|
|
|
|
/**
|
|
* AI内容创作
|
|
*/
|
|
export async function manuscriptGen(
|
|
data: ManuscriptGenParams,
|
|
config?: AxiosRequestConfig
|
|
) {
|
|
const res = await request.post<ApiResult<ManuscriptGenResult>>(
|
|
MODULES_API_URL + '/ai/manuscriptGen',
|
|
data,
|
|
config
|
|
);
|
|
if (res.data.code === 0) {
|
|
return res.data.data;
|
|
}
|
|
return Promise.reject(new Error(res.data.message || '生成失败'));
|
|
}
|