|
@@ -40,6 +40,9 @@ app.use(function (req, res, next) {
|
|
|
res.header('X-Powered-By', ' 3.2.1')
|
|
res.header('X-Powered-By', ' 3.2.1')
|
|
|
//内容类型:如果是post请求必须指定这个属性
|
|
//内容类型:如果是post请求必须指定这个属性
|
|
|
res.header('Content-Type', 'application/json;charset=utf-8')
|
|
res.header('Content-Type', 'application/json;charset=utf-8')
|
|
|
|
|
+ if (req.method === 'OPTIONS') {
|
|
|
|
|
+ return res.sendStatus(204);
|
|
|
|
|
+ }
|
|
|
next();
|
|
next();
|
|
|
});
|
|
});
|
|
|
|
|
|