轉載地址:https://www.cnblogs.com/xiaoxiaoluoye/p/6945044.html
深入學習地址:https://www.cnblogs.com/Hwangzhiyoung/p/9146740.html
控制檯報錯:
Refused to load the image '<URL>' because it violates the following content security polity diretive: 'default-src *'. Note that 'img-src' was not explicity set. so 'default-src' is used as a fallback.
(拒絕加載圖像“ <URL>”,因爲它違反了以下內容安全規定:“ default-src *”。 請注意,未明確設置“ img-src”。)
解決辦法:
<meta http-equiv="Content-Security-Policy" content="default-src *;img-src 'self' data: base64; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'"/>
設置 " img-src 'self' data: base64; " 即可。