Javascript前端下载后台传来的文件流代码实例
前台请求数据: url: '/app/downloadApp', method: 'get', responseType: 'blob', params: data 设置接收参数格式为responseType: ‘blob’, downloadFile(res, fileName) { if (!res) { return } if (window.navigator.msSaveBlob) { // IE以及IE内核的浏览器 try { window.navigator.msSaveBlob(res, fileName)
下载地址
用户评论