mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-09 10:56:44 +08:00
工具下载
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user