有两个错误Uncaught (in promise) TypeError: Failed to fetchFailed 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));
添加回答
举报
0/150
提交
取消