console.log('res', res)
//token 是使页面不用去登录了
if (res.file) {
window.location.href =
Vue.prototype.$config.VUE_APP_BASE_IDSWAPI +
Vue.prototype.$config.VUE_APP_IDSW +
'/service/models/download?action=zip&filepath=' +
encodeURIComponent(encodeURIComponent(res['file'])) +
`&token=${localStorage.getItem('inmsToken')}&accessToken=${localStorage.getItem('accessToken')}`
}
responseType: “blob”,
let blob = new Blob([response.data], { type: “application/zip” }); //注意是response 或者 response.data
let url = window.URL.createObjectURL(blob); 这三句最重要!!!
//普通代码
axios.post(postUrl, params, {responseType: 'arraybuffer'}).then(res => {
// 创建Blob对象,设置文件类型
let blob = new Blob([res.data], {type: "application/vnd.ms-excel"})
let objectUrl = URL.createObjectURL(blob) // 创建URL
location.href = objectUrl;
URL.revokeObjectURL(objectUrl); // 释放内存
})
downloadAll() {
axios({
method: "get",
url: "api/TemplateDownload/GetAllTemplateZIP",
headers: {
"content-type": "application/json; charset=utf-8",
Authorization: Cookies.get("token") || "",
},
responseType: "blob",
})
.then((response) => {
let blob = new Blob([response.data], { type: "application/zip" });
let url = window.URL.createObjectURL(blob);
const link = document.createElement("a"); // 创建a标签
link.href = url;
link.download = "模板下载"; // 重命名文件
link.click();
URL.revokeObjectURL(url); // 释放内存
this.checkList = [];
})
.catch((error) => {
console.log(error.data);
});
},
//excel
let blob = new Blob([response.data], { type: "application/vnd.ms-excel" });
dl() {
axios({
method: "get",
url: "http://10.180.170.3:8794/tRptMwStdClt/exportData?time=202104",
responseType: "arraybuffer",
})
.then((response) => {
console.log(response);
let blob = new Blob([response.data], {
type: "application/vnd.ms-excel",
});
let url = window.URL.createObjectURL(blob);
const link = document.createElement("a"); // 创建a标签
link.href = url;
link.download = "模板下载"; // 重命名文件
link.click();
URL.revokeObjectURL(url); // 释放内存
this.checkList = [];
})
.catch((error) => {
console.log(error.data);
});
},
既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上大数据知识点,真正体系化!
由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新
、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新**