// 方式一 jsp页面验证是可以的
function exportVideo(path, videofile) {
const url = path + '?response-content-type=application/octet-stream' // 跨域下载
const a = document.createElement('a') // 创建一个a标签
a.href = url // 下载链接
a.download = videofile // 下载后文件名 【可自定义名称】
a.style.display = 'none' // 元素不会被显示
document.body.appendChild(a) //页面DOM树添加a标签
a.click() // 点击下载
document.body.removeChild(a) // 下载完成移除元素
}
// 简化
function download(path,videofile){
const a = document.createElement("a");
a.href = path+'?response-content-type=application/octet-stream';
a.download = videofile; // 可自定义
a.click();
document.body.removeChild(a) // 下载完成移除元素
}