// 允许跨域访问
app.all('*', function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "Content-Type");
res.header("Access-Control-Allow-Methods", "PUT,POST,GET,DELETE,OPTIONS");
// res.header("Content-Type", "application/json;charset=utf-8");
next();
});
Node.js Express 跨域
最新推荐文章于 2024-05-08 00:59:40 发布