![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
axios
考拉菜鸟
这个作者很懒,什么都没留下…
展开
-
input选择文件的类型type
文件上传和传输中,<input type="file" id="input" accept=".doc,.docx,application/msword,application/zip">accept定义了文件 input 应该接受的文件类型。这个字符串是一个以逗号为分隔的 唯一文件类型说明符 列表。通过 File API,我们可以访问 FileList,它包含了表示用户所选文件的 File 对象file对象https://developer.mozilla.org/zh-CN/原创 2021-03-03 14:54:21 · 901 阅读 · 1 评论 -
模拟postman的send-and-download,前端请求实现
当后端接口返回流文件,使用postman的send and download可以直接将文件下载,但是前端应该怎么写接口响应逻辑exportHandler(data){ let self = this; let params = { name: data.name, Id: data.id }; //请求接口 axios({ method: 'get', url:'/export/file', params: params, responseType: 'blob'原创 2021-03-02 11:49:34 · 9276 阅读 · 4 评论