本节主要介绍Web项目中的跨域问题,以及解决方法中间件。本节主要以GoWeb项目为例。
跨域问题
Access to fetch at ‘http://127.0.0.1:1323/blog/articleotherAll’ from origin ‘http://127.0.0.1:7788’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. If an opaque response serves your needs, set the request’s mode to ‘no-cors’ to fetch the resource with CORS disabled.