Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用antd的上传组件向oss上传文件的时候提示跨域 #250

Open
ideaviewes opened this issue May 12, 2020 · 2 comments
Open

使用antd的上传组件向oss上传文件的时候提示跨域 #250

ideaviewes opened this issue May 12, 2020 · 2 comments

Comments

@ideaviewes
Copy link

ideaviewes commented May 12, 2020

使用的antd版本是3.19.5,上传的方法是服务器端签名,js直传
我可以确定的是oss是配置了允许跨域的,小程序可以通过我服务器段生成的签名,policy上传文件
oss提供的jssdk也是可以的,但是用antd的上传组件不行,一直提示跨域
Access to XMLHttpRequest at 'https://xxx.com/' from origin 'https://xxxxxx.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
具体代码如下

tmp

@sun-shu
Copy link

sun-shu commented Dec 9, 2020

咋解决的?

@iHaroro
Copy link

iHaroro commented Aug 11, 2022

考虑oss是否配置前端直传的跨域头
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants