下载文件如何规避跨域问题
一般我们的下载功能会通过 XHR 对象 发送,不可避免的会出现跨域问题。
解决办法:
可以通过修改为 http Get 请求,前端通过 window.open(downloadLink
)的方式下载
Be the first to know when I post cool stuff
Subscribe to get my latest posts by email.
Thanks for signing up! Check your email to confirm your subscription.
Whoops, we weren't able to process your signup.