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();
 });