提交getFileSteam

This commit is contained in:
weibl
2026-02-26 14:37:28 +08:00
parent 5e54f0c652
commit 50fd9fa91d

View File

@@ -90,6 +90,23 @@ const upload = async (url: string, formData = {}, onProgress?: any) => {
return res.data;
};
/**
*
* @param url
* @param data
* @returns 文件的 内容
*/
export const getFileSteam = async (url: string, data = {}) => {
const res: any = await service.post(url, data);
console.log('res', res);
if (res.status === 200) {
return res.request.response;
} else {
ElMessage.warning('获取文件流失败!');
}
return '';
};
const download = async (url: string, params = {}, filename = 'download') => {
const res: any = await service
.post(url, params, {