PixelAI-admin/src/api/attachment/index.ts

38 lines
930 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import request from '/@/utils/request';
import { baseUrlHost } from '../baseUrlHost';
/**
* (不建议写成 request.post(xxx),因为这样 post 时,无法 params 与 data 同时传参)
* 注意在写get请求时参数是params而不是data要标注好
*
* 登录api接口集合
* @method getAttachmentList 分页查询附件
* @method getAttachmentDetail 查看单个附件
* @method downloadFiles 批量文件下载
*/
export function attachmentApi() {
return {
getAttachmentList: (params: object) => {
return request({
url: baseUrlHost + '/enAttachment',
method: 'get',
params,
});
},
getAttachmentDetail: (id: Number) => {
return request({
url: baseUrlHost + `/enAttachment/${id}`,
method: 'get',
});
},
downloadFiles: (ids: object) => {
return request({
url: baseUrlHost + '/enAttachment/uploadByType',
method: 'get',
ids,
})
}
};
}