有两个错误
Uncaught (in promise) TypeError: Failed to fetch
Failed to load 'url链接' Request header field Content-Type is not allowed by Access-Control-Allow-Headers in preflight response.
这是代码
url那里我原来放的是后台给的地址
fetch('url',
{
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({"password": values.password})
}).then(res => res.json()).then(json => console.log(json));
跃然一笑
白板的微信
随时随地看视频慕课网APP
相关分类