3
企业微信h5应用文件下载名称编码
source link: https://www.oschina.net/question/4538334_2323839
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
企业微信h5应用文件下载名称编码
本地调试文件名没问题,在企微打开后文件名编码。
download (item, index, file) {
// 1
const link = document.createElement('a')
const fileName = item.name
const fileUrl = item.url
link.setAttribute('download', fileName) // 下载的文件名
link.href = fileUrl // 文件url
link.click()
// 2
const fileUrl = item.url
const fileName = item.name
fileSaver.saveAs(fileUrl, fileName)
// 3
window.location.href = item.url
},
求助一下大佬们 谢谢
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK