a标签下载指定oss地址的文件。下载文件名称下载下来时是oss文件的路径,而不是我设定的文件名称。a标签有设置download属性。但不起作用
` / 下载模板事件 /
createTagForDownload = (fileName) => {
const body = document.querySelector('body')
const a = document.createElement('a')
a.setAttribute('href',downFileHref)
a.setAttribute('download',fileName)
a.style.display = 'none'
body.appendChild(a)
a.click()
body.removeChild(a)
window.URL.revokeObjectURL(downFileHref);
}`
同源吗?或者说你文件跨域吗?download属性只能是同源URL