if(req.headers.origin == config.allowOrigin.int || req.headers.origin == config.allowOrigin.ext){
  res.header("Access-Control-Allow-Origin", req.headers.origin);
  res.header("Access-Control-Allow-Headers", "Content-Type, Authorization, X-Requested-With");
  res.header("Access-Control-Allow-Methods", "PUT,POST,GET,DELETE,OPTIONS");
  res.header("Access-Control-Allow-Credentials", true); //可以带cookies
  res.header("Content-Type", "application/json; charset=utf-8")
  res.header("X-Powered-By", '3.2.1')
}
作者 铁血 汉子 2019年11月17日
2024/03/28/11:22:39pm 2019/11/17/17:44:56
0 5716