取到后端数据后下载文件 之 a 标签 搞定
<div>
<button id="btn">测试</button>
<a href="public/favicon.ico" download="fav.icon" id="test">asf</a>
</div>
<script>
document.getElementById('btn').onclick =function(){
// 一顿ajax操作后,拿到文件路径 path,
let aEl = document.getElementById('test')
aEl.setAttribute('href', path)
aEl.click()
}
</script>
A little hug, little gift.
All of little something.
these are our meories.