lsc hai 1 semana
pai
achega
1d63889d31
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      app.js

+ 3 - 0
app.js

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