您好我有下载文件excel(.xlsx)的功能:
getXls(params) {
return this.$http.post('/api/xls', params, {
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'responseType': 'blob'
}
}).then((response) => {
let blob = new Blob([response.data], { type: response.headers("content-type") });
saveAs(blob, response.headers('content-disposition').split('=')[1])
})