美文网首页
axios 通过get 请求下载文件

axios 通过get 请求下载文件

作者: waiterYu | 来源:发表于2019-10-09 15:52 被阅读0次
 axios.get('/system/platform/feedbackManager/findBuyUserFedbackPage',  {
            responseType: 'blob',
            params: data
        }).then(res => {
         let url = window.URL.createObjectURL(new Blob([res.data]));
                let link = document.createElement("a");
                link.style.display = "none";
                link.href = url;
                link.setAttribute("download", this.$route.meta.title + ".xlsx");

                document.body.appendChild(link);
                console.log(res);

                link.click();
    })

相关文章

网友评论

      本文标题:axios 通过get 请求下载文件

      本文链接:https://www.haomeiwen.com/subject/itegpctx.html