axios中的请求超时,设置请求时间

this.$axios({
url: `/sampleBase/playingExportExcel`,
method: 'get',
timeout: 600000,
responseType: 'blob',
params: {
pageNum: this.pageParam.pageNum,
pageSize: this.pageParam.pageSize,
}
}).then((data) => {
this.$Loading.finish();
setTimeout(() => {
this.exportBtnDisabled = false
}, 1500)
// const blob = new Blob([data], { type: 'text/plain;charset=utf-8' })
const url = window.URL.createObjectURL(data.data)
const a = document.createElement('a')
a.href = url
a.download = '样衣列表.xls'
document.body.appendChild(a)
a.click()
window.URL.revokeObjectURL(url)
document.body.removeChild(a)
})
posted @ 2019-07-30 14:13  苏小白啊  阅读(8155)  评论(0编辑  收藏  举报