当前位置:网站首页 > Vue.js开发 > 正文

VUE报错because it violates the following Content Security Policy directive

VUE启动服务后控制台报错: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.

拒绝加载图像“http://localhost:8080/favicon.ico” 因为它违反了以下内容安全策略指令: “默认SRC‘none’”。请注意,没有显式设置“img-src”, 所以“default src”用作回退。

报错原因:修改了config/index.js里面的assetsPublicPath: '/',的路径,所以报错。 

重新改回 assetsPublicPath: '/',即可 

assetsPublicPath: '/',

 

到此这篇VUE报错because it violates the following Content Security Policy directive的文章就介绍到这了,更多相关内容请继续浏览下面的相关推荐文章,希望大家都能在编程的领域有一番成就!

版权声明


相关文章:

  • VUE实现延时请求接口2024-12-01 08:45:07
  • VUE控制台报错: [vue-router] Duplicate named routes definition: { name: "NotFound", path: "*" }2024-12-01 08:45:07
  • vue动态路由:路由参数改变,视图不更新问题的解决2024-12-01 08:45:07
  • Nuxt.js报错:Classic mode for store/ is deprecated and will be removed in Nuxt 32024-12-01 08:45:07
  • Nuxt.js中安装使用插件【ElementUI,axios,scss】2024-12-01 08:45:07
  • vue路由切换报错message: "Navigating to current location (XXX) is not allowed"的解决方案2024-12-01 08:45:07
  • VUE根据token,路由判断用户登录状态并跳转登录页2024-12-01 08:45:07
  • VUE-axios统一增加请求头并根据接口返回的状态码判断用户登录状态并跳转登录页2024-12-01 08:45:07
  • VUE项目启动后特定接口只调用一次2024-12-01 08:45:07
  • vue 判断页面是首次进入还是再次刷新2024-12-01 08:45:07
  • 全屏图片