随笔分类 -  上传&下载

摘要:const beforeUpload = (file) => { return new Promise((resolve, reject) => { let acceptList = [".xls",".xlsx",".pdf",".doc",".docx",".jpg",".jpeg",".png 阅读全文
posted @ 2022-06-22 16:53 天官赐福· 阅读(75) 评论(0) 推荐(0) 编辑
摘要:import axios from "axios"; export const axiosDownload = async (url, params, fileName) => { let res = await axios.get(url, { responseType: 'blob', head 阅读全文
posted @ 2022-06-21 12:17 天官赐福· 阅读(345) 评论(0) 推荐(0) 编辑
摘要:axios({ // 用axios发送post请求 method: 'post', url: '', // 请求地址 data: req, // 参数 headers: { 'content-type': 'application/json; charset=utf-8', }, responseT 阅读全文
posted @ 2022-06-21 11:20 天官赐福· 阅读(371) 评论(0) 推荐(0) 编辑
摘要:const service = axios.create({}); let formData = new FormData(); formData.append('file', file.file.originFileObj);//文件 formData.append('req', JSON.str 阅读全文
posted @ 2022-06-21 11:11 天官赐福· 阅读(470) 评论(0) 推荐(0) 编辑
摘要:后台返回数据涨这个样子: 前端处理: let blob = new Blob([response], { type: "application/x-xls" }); //res--后台返回的文件流 let link = document.createElement("a"); link.href = 阅读全文
posted @ 2021-08-13 15:55 天官赐福· 阅读(699) 评论(0) 推荐(0) 编辑

返回顶端
点击右上角即可分享
微信分享提示