from origin ‘null‘ has been blocked by CORS policy: Request header field token is not allowed by Acc

tech2024-08-19  44

from origin ‘null’ has been blocked by CORS policy: Request header field token is not allowed by Access-Control-Allow-Headers in preflight response.

遇到这种类似的问题一般都是跨域请求问题,后端可以这样设置返回请求头

然后就可以请求成功了,因为携带token请求头,所以需要

response.setHeader("Access-Control-Allow-Headers","token")

最新回复(0)