//请求接口中配置
responseType: 'blob',
//接口请求后处理
importDutyTemplate(params).then(res => {
// return
let blob = new Blob([res.data], {
type: 'application/vnd.ms-excel',
});
let url = window.URL.createObjectURL(blob);
let link = document.createElement('a');
link.href = url;
link.download = '值班日志导入模板.xlsx';
link.click();
window.URL.revokeObjectURL(url);
})
};