import axios from "axios";
import qs from "qs";
if (item.resourceName == "导出") {
const [startTime = "", endTime = ""] = this.rangeTime || [];
let params = {
carNumber: this.carNumber,
billStatus: this.billStatus,
userPhone: this.userPhone,
billCode: this.billCode,
buildCodeList: this.buildCodeList,
timeType: this.timeType,
startTime,
endTime,
page: this.page,
size: this.size,
};
axios
.post(exportReservationList, qs.stringify(params), {
headers: {
"Content-Type": "application/x-www-form-urlencoded",
},
responseType: "blob",
})
.then((response) => {
// 从响应头中获取文件名
const contentDisposition = response.headers["content-disposition"];
console.log("
标签:www,const,form,URL,filename,Content,matches,link,error
From: https://www.cnblogs.com/hxy--Tina/p/18182958