mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-15 13:56:43 +08:00
导出pdf打不开解决
This commit is contained in:
@@ -105,7 +105,7 @@ const ids=function (data){
|
||||
* */
|
||||
const exportExcel=function (data){
|
||||
// return ajax.postJsonToFile(baseURL,'/xboe/subgroup/m/noteinfo/exportExcel',data);
|
||||
return ajax.post(baseURL,'/xboe/subgroup/m/noteinfo/exportExcel',data,{responseType: 'blob'});
|
||||
return ajax.post(baseURL,'/xboe/subgroup/m/noteinfo/exportExcel',data);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -115,7 +115,7 @@ const exportExcel=function (data){
|
||||
* }
|
||||
* */
|
||||
const exportExcelPre=function (data){
|
||||
return ajax.post(baseURL,'/xboe/subgroup/m/noteinfo/excel-detail',data,{responseType: 'blob'});
|
||||
return ajax.post(baseURL,'/xboe/subgroup/m/noteinfo/excel-detail',data);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -300,7 +300,7 @@ export default {
|
||||
this.$message.error('导出失败');
|
||||
} else {
|
||||
const link = document.createElement('a');// 创建a标签
|
||||
let blob = new Blob([res],{type: 'application/vnd.ms-pdf;charset=UTF-8'}); // 设置文件类型
|
||||
let blob = new Blob([res],{type: 'application/vnd.pdf;charset=UTF-8'}); // 设置文件类型
|
||||
link.style.display = "none";
|
||||
link.href = URL.createObjectURL(blob); // 创建URL
|
||||
link.setAttribute("download", "我的笔记.pdf");
|
||||
|
||||
Reference in New Issue
Block a user