uniapp post请求后台数据报错-解决
(1)跨域问题hasbeenblockedbyCORSpolicy:Responsetopreflightrequestdoesn'tpassaccesscontrolcheck:No'Access-Control-Allow-Origin'headerispresentontherequestedresource.解决:【具体配置方法根据后台...
·
(1)跨域问题
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.
解决:【具体配置方法根据后台类型】
'Access-Control-Allow-Origin: *'
'Access-Control-Allow-Headers: Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With'
(2)请求404
has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.
解决:
配置请求头
header: {
'content-type':'application/x-www-form-urlencoded'
},
更多推荐
已为社区贡献10条内容
所有评论(0)