0

我已经使用活动蓝图 API 航行 v1.0,我想更新我的模型中的一个字段,所以如果我使用 PUT 方法进行 Ajax 调用,它会告诉我:

调试:在 Sails 1.0 中不推荐使用 PUT 更新记录。改用补丁!

但如果我改用 PATCH ,它会说:

预检响应中的 Access-Control-Allow-Methods 不允许方法 PATCH。

我的 security.js 配置文件是:

module.exports.security = {

   cors : {
      allRoutes: true,
      allowOrigins: ["http://localhost", "https://localhost"],
      allowRequestMethods: 'GET, POST, DELETE, OPTIONS, HEAD, PATCH, PUT',
      allowRequestHeaders: 'content-type',
   }
};

谁能帮我??问候

4

1 回答 1

0

Try creating an OPTIONS route with response 200.

于 2018-07-06T17:39:37.280 回答