导出订单 
接口功能 
导出订单
URL 
支持格式 
JSON
HTTP请求方式 
POST
header头 
| 参数 | 必选 | 类型 | 说明 | 
|---|---|---|---|
| token | true | String | token | 
请求参数 
| 参数 | 必选 | 类型 | 说明 | 
|---|---|---|---|
| tab | true | string | 订单类型:all全部,nopay待支付,noship待发货,shiped待收货,received已收货,finish已完成,closed已关闭,refunding退款中 | 
| starttime | false | string | 开始时间,yyyy-mm-dd | 
| endtime | false | string | 结束时间,yyyy-mm-dd | 
接口示例 
地址:http://ceshi5.dishait.cn/admin/order/excelexport?tab=all&starttime=2020-11-01&endtime=2020-11-02
json5
无js前端处理 
js
this.axios.post(url, {}, {
  token: true,
  responseType: "blob", // 重要
}).then((res) => {
  if (res.status == 200) {
    let url = window.URL.createObjectURL(new Blob([res.data]));
    let link = document.createElement("a");
    link.style.display = "none";
    link.href = url;
    let filename = new Date().getTime() + ".xlsx";
    link.setAttribute("download", filename);
    document.body.appendChild(link);
    link.click();
  }
}).catch((err) => {
  this.$message({
    type: "error",
    message: "下载失败",
  });
});