随笔分类 - 上传&下载
摘要:const beforeUpload = (file) => { return new Promise((resolve, reject) => { let acceptList = [".xls",".xlsx",".pdf",".doc",".docx",".jpg",".jpeg",".png
阅读全文
摘要:import axios from "axios"; export const axiosDownload = async (url, params, fileName) => { let res = await axios.get(url, { responseType: 'blob', head
阅读全文
摘要:axios({ // 用axios发送post请求 method: 'post', url: '', // 请求地址 data: req, // 参数 headers: { 'content-type': 'application/json; charset=utf-8', }, responseT
阅读全文
摘要:const service = axios.create({}); let formData = new FormData(); formData.append('file', file.file.originFileObj);//文件 formData.append('req', JSON.str
阅读全文
摘要:后台返回数据涨这个样子: 前端处理: let blob = new Blob([response], { type: "application/x-xls" }); //res--后台返回的文件流 let link = document.createElement("a"); link.href =
阅读全文