this.$http.get(url,{ params: {id: ids}, headers: {"header1": "test1", "header2": "test2"}, responseType: 'blob' }).then(res => { let fileName = ''; if(res.headers["content-disposition"]){ var a = document.createElement('a'); fileName = res.headers["content-disposition"].split(";")[1].split("=")[1]; a.download = fileName; a.href = URL.createObjectURL(res.data); // blob内容 a.click(); }else{ this.$message({ message: "下载文件出错!", type: "warning" }); } }).catch(err => { this.$message({ message: err, type: "err" }); })