提交getFileSteam
This commit is contained in:
@@ -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, {
|
||||
|
||||
Reference in New Issue
Block a user