这是提出请求
axios({
method: 'PUT',
url: signedRequest,
data: file,
headers: {
'Content-Type': 'multipart/form-data',
'Access-Control-Allow-Origin': '*'
}
})
.then((response) => {
console.log(response)
}).catch((error) => {
console.log(error)
});
这里是 cors 配置
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<AllowedMethod>PUT</AllowedMethod>
<MaxAgeSeconds>9000</MaxAgeSeconds>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>
这是跨源错误
Failed to load https://tochpro.s3-us-west-2.amazonaws.com/wehab/373-285x215.jpg%20%20%20%20?AWSAccessKeyId=AKIAIH7OJGP3PNYIN5YQ&Content-Type=multipart%2Fform-data&Expires=1559998463&Signature=3iLYA0VwD3SjkHOkPfCQALvLSk0%3D: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access.
请帮助我摆脱这个错误...请让我知道我在这里缺少什么...