1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
| /* eslint-disable */
| // @ts-ignore
| import { request } from '@/utils/request';
|
| /** 此处后端没有提供注释 POST /api/OpenInformation/UploadInformation */
| export async function uploadInformation(
| body: {
| /** 密钥 */
| Secret?: string;
| /** 标题 */
| Title?: string;
| /** 作者 */
| Author?: string;
| /** 正文 */
| Body?: string;
| /** 栏目Id */
| TypeId?: string;
| /** 封面 */
| CoverInfo?: string;
| /** 采集的源地址 */
| AcquisitionSourceLink?: string;
| },
| options?: API.RequestConfig
| ) {
| const formData = new FormData();
|
| Object.keys(body).forEach((ele) => {
| const item = (body as any)[ele];
|
| if (item !== undefined && item !== null) {
| formData.append(
| ele,
| typeof item === 'object' && !(item instanceof File) ? JSON.stringify(item) : item
| );
| }
| });
|
| return request<number>('/api/OpenInformation/UploadInformation', {
| method: 'POST',
| data: formData,
| requestType: 'form',
| ...(options || {}),
| });
| }
|
|