错误信息
Refused to execute inline script because it violates the following
Content Security Policy directive: "default-src 'self'". Either the
'unsafe-inline' keyword, a hash ('sha256-
kPY6ovEPaw5y+RgWpejDaoJa2JT9tURMxvKvnhgv1XM='), or a nonce ('nonce-...')
is required to enable inline execution. Note also that 'script-src' was
not explicitly set, so 'default-src' is used as a fallback.
个人的解决方案
提交按钮采用了submit,将submit改为button解决
解决方案(来源于网络,对我的问题并没有解决,但是很多人都提供这种方案)
<head>
<meta charset="utf-8">
<title>testing</title>
<meta http-equiv="Content-Security-Policy" content="default-src *; connect-src * ws://* wss://*; style-src * 'unsafe-inline' 'unsafe-eval'; media-src * ; img-src * data:; font-src * ; script-src * 'unsafe-inline' 'unsafe-eval';" />
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
希望有好的解决方案的大佬指教