前端请求接口报错,接口返回:404;
前端控制台错误信息提示:Access to XMLHttpRequest at xxx has been blocked by CORS policy:request header field content-type is not allowed by
Access-Control-Allow-Headers is preflight response;
原因是前端发送得请求中,header中包括了不被允许的请求头,比如使用JWT时,前端请求在header中带上Authorization传递token,如果后端拦截器中未配置,则报错