第一步 npm install js-file-download 第二步 import fileDownload from 'js-file-download' axios.get(`/operation/ruleImport/template`, { responseType: 'blob' //返回的数据类型 }) .then(res => { fileDownload(res.data, this.fileName)//this.fileName你需要的文件名,要带后缀 })