Files
fe_service_ebtp_frontend/src/services/download_.ts
2022-04-01 20:06:34 +08:00

56 lines
1.3 KiB
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 { downloadSecretKeyPath, findFilelistPath, findFilelistPathBySecond, getSnowIdPath, removeFilePath } from '@/utils/DownloadUtils';
import request from '@/utils/request';
/**
* 获取密钥(用于下载附件)
* @param {主键} fileId
* @returns
*/
export async function getDownloadSecretKey({ fileId }: any) {
return request(downloadSecretKeyPath, {
method: 'GET',
params: { fileId },
});
}
/**
* 获取雪花id
* @returns
*/
export async function createNewFileBid() {
return request(getSnowIdPath, {
method: 'GET'
})
}
/**
* 根据fileId删除文件
* @param {主键} fileId
* @returns
*/
export async function removeFileByOid(fileId: string) {
return request(removeFilePath, {
method: 'POST',
params: { fileId },
})
}
/**
* 根据objectIdList查询文件列表
* @param {业务id列表} objectIdList
* @returns
*/
export async function getFilelist(objectIdList: string[]) {
return request(findFilelistPath, {
method: 'POST',
data: [...objectIdList],
})
}
/**
* 根据bid查询文件列表2.0
* @param {业务id列表} id
* @returns
*/
export async function getFilelistBySecond(id: string, p: string) {
return fetch(findFilelistPathBySecond + '?id=' + id + '&p=' + p, {
method: 'POST',
})
}