一。网上大多都是说把response的数据转换为base64或是blob转换url到a标签中进行下载。但是在华为云上的文件,上面的操作是视频文件是直接下载,但是显示文件损坏。或者就是在线预览。其实可以在华为云的url链接后面上一个
?response-content-type=application/octet-stream`
这样就可以让浏览器知道是要下载文件
因为华为云url链接的返回体类型就是content-type=application/octet-stream
封装为方法
export function downloadByUrlAndZdy({
url, target = '_blank', fileName }) {
if (/(iP)/g</