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

38 lines
955 B
TypeScript
Raw Normal View History

import request from '/@/utils/request';
import { baseUrlHost } from '../baseUrlHost';
/**
* request.post(xxx) post params data
* get请求时paramsdata
*
* 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: String) => {
return request({
url: baseUrlHost + `/enAttachment/downloadFiles/${ids}`,
method: 'get',
responseType: 'blob',
})
}
};
}