lsc 1 周之前
父節點
當前提交
1d63889d31
共有 1 個文件被更改,包括 3 次插入 和 0 次删除
  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();
 });