Skip to content

node写后台,axios携带cookie跨域解决


//在node中
// res.header('Access-Control-Allow-Origin', '*');//把这个换掉
res.header("Access-Control-Allow-Origin", req.headers.origin);//换成这个
res.header("Access-Control-Allow-Credentials",true);//再加上这行