- 将本网站保存到桌面的功能
download() {
axios({
method: "get",
url: "http://www.xxx.com/shortcut.url",
data: {},
responseType: "blob"
}).then(res => {
let data = res.data;
let url = window.URL.createObjectURL(new Blob([data]));
let link = document.createElement("a");
link.style.display = "none";
link.href = url;
link.setAttribute("download", "xxx.url");
document.body.appendChild(link);
link.click();
});
}