康来智慧冷链系统 - 前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

24 lines
1.2 KiB

/**
* 提供api模板规范代码参考,请尽量保证编写代码风格跟模板规范代码一致
* Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> All rights reserved.
* author entfrm开发团队-王翔
*/
import type { PushFileParams, PushFileResult } from '/@/api/platform/common/entity/pushFile';
import { defHttp } from '/@/utils/http/axios';
import { UploadFileParams } from '/#/axios';
import { UploadResult } from '/@/api/platform/core/entity/upload';
import {useGlobSetting} from '/@/hooks/setting';
const { apiUrl } = useGlobSetting();
enum Api {
list = '/common_proxy/common/pushFile/list',
upload = '/common_proxy/common/pushFile/upload',
del = '/common_proxy/common/pushFile/remove'
}
export const listPushFile = (params?: Partial<PushFileParams>) => defHttp.get<PushFileResult>({ url: Api.list, params }, { isReturnResultResponse: true });
export const commonUpload = (params: UploadFileParams, onUploadProgress: (progressEvent: ProgressEvent) => void) =>
defHttp.uploadFile<UploadResult>({ url: apiUrl + Api.upload, onUploadProgress }, params);
export const delPushFile = (ids: string) => defHttp.delete({ url: `${Api.del}/${ids}` });