在Swagger请求失败:Failed to fetch. Possible Reasons: CORS Network Failure URL scheme must be "http" or "https" for CORS request
在swagger-ui中呈现的错误是:
只看此图大概率以为是跨域的问题或者schema
中没有配置请求协议http/https
引起的,但是Chrome控制台的错误提示是:
Refused to load the script 'http://xxxxx' because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-eval' 'unsafe-inline'"
认真检查了项目都没问题,最后想起来安装过几个包最后又卸载掉了,最后把node_modules
全部删除用npm i
重新安装,安装完后成一切正常。
太诡异了。