首页 前端知识 vue报错Refused to evaluate a string as JavaScript because ‘unsafe-eval’ is not an allowed...

vue报错Refused to evaluate a string as JavaScript because ‘unsafe-eval’ is not an allowed...

2024-08-25 23:08:35 前端知识 前端哥 184 827 我要收藏

electron 使用sequelize报错Uncaught EvalError: Refused to evaluate a string as JavaScript because ‘unsafe-eval’ is not an allowed source of script in the following Content Security Policy directive: “script-src ‘self’”.
解决
Electron中开启了内容安全策略(CSP)
把html中meta标签,增加’unsafe-eval’

<meta http-equiv="Content-Security-Policy" content="script-src 'self' ">

改为

<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-eval'">
转载请注明出处或者链接地址:https://www.qianduange.cn//article/16885.html
标签
electron
评论
发布的文章

安装Nodejs后,npm无法使用

2024-11-30 11:11:38

大家推荐的文章
会员中心 联系我 留言建议 回顶部
复制成功!