Cannot GET /问题解决

遇到问题如图:

 

Cannot GET /问题解决_第1张图片


错误描述

Refused to load the image 'http://localhost:8080/favicon.ico' because it violates the following Content Security Policy directive: "default-src 'none'". Note that 'img-src' was not explicitly set, so 'default-src' is used as a fallback.

解决方法

config–>index.js中的 assetsPublicPath: '/'改成`assetsPublicPath: ‘./’


我的配置是 assetsPublicPath: '.' 修改成  assetsPublicPath: '/'可以解决这个问题,我这里修改了两处;

网有很多说要设置/favicon.ico这个图标,我设置后好使,依情况而定吧,只是记录自己的bug修复

你可能感兴趣的:(vue)