工具下载

This commit is contained in:
nisen
2023-09-05 15:07:37 +08:00
parent 5f4fc5d2e8
commit fa6a926ffd

View File

@@ -75,20 +75,21 @@ export default {
},
downLoad(toolInfo) {
console.log(toolInfo);
toolDown({
urlStr: `${process.env.VUE_APP_BOE_WEB_URL}/upload${toolInfo.filePath}`,
fileName: toolInfo.name
}).then((result) => {
const link = document.createElement('a');// 创建a标签
let blob = new Blob([result.data], { type: '' }); // 设置文件类型
link.style.display = "none";
link.href = URL.createObjectURL(blob); // 创建URL
link.setAttribute("download", `${toolInfo.name}`);
document.body.appendChild(link);
link.click();
URL.revokeObjectURL(link.href);
document.body.removeChild(link);
})
window.open(`/activityApi/xboe/m/boe/tools/url/download?urlStr=${process.env.VUE_APP_BOE_WEB_URL}/upload${toolInfo.filePath}&fileName=${toolInfo.name}`)
// toolDown({
// urlStr: `${process.env.VUE_APP_BOE_WEB_URL}/upload${toolInfo.filePath}`,
// fileName: toolInfo.name
// }).then((result) => {
// const link = document.createElement('a');// 创建a标签
// let blob = new Blob([result.data], { type: '' }); // 设置文件类型
// link.style.display = "none";
// link.href = URL.createObjectURL(blob); // 创建URL
// link.setAttribute("download", `${toolInfo.name}`);
// document.body.appendChild(link);
// link.click();
// URL.revokeObjectURL(link.href);
// document.body.removeChild(link);
// })
},
getPic(index) {
return this.webBaseUrl + "/images/listblue0" + (index + 1) + ".png";
@@ -105,9 +106,10 @@ export default {
};
</script>
<style scoped lang='scss'>
.nav:hover{
.nav:hover {
color: #387DF7;
}
.toolBanner {
width: 100%;
height: 240px;