app.all('*', function(req, res, next) {
    res.header("Access-Control-Allow-Origin", "*");
    res.header("Access-Control-Allow-Headers", "Content-Type,Content-Length, Authorization, Accept,X-Requested-With");
    res.header("Access-Control-Allow-Methods","PUT,POST,GET,DELETE,OPTIONS");
    res.header("X-Powered-By",' 3.2.1')
    if(req.method=="OPTIONS") res.send(200);/*让options请求快速返回*/
    else  next();
});

相关文章:

  • 2021-10-11
  • 2021-09-30
  • 2021-07-04
  • 2021-09-03
  • 2022-01-07
  • 2021-11-11
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-29
  • 2022-12-23
  • 2022-12-23
  • 2021-08-05
  • 2021-06-17
  • 2021-11-26
  • 2021-08-29
相关资源
相似解决方案