在本地做一个前后分离的项目,用的egg,出现 OPTIONS /api/posts] nodejs.MethodNotAllowedError: Method Not Allowed 我前端用的fetch api,貌似跨域会默认发送一条options请求,我也在后端项目里面加了
router.options('/api/posts', controller.post.option)
但是却出现OPTIONS /api/posts] nodejs.MethodNotAllowedError: Method Not Allowed的错误