Uncaught ReferenceError: wx is not defined

程序的分享功能调用了微信的接口,但是忽然发现就报这个错误,

Uncaught ReferenceError: wx is not defined

同时下方还有这个错误

This content should also be served over HTTPS.

访问接口,网络是通的,后来想起,项目前段时间升级了一次,从http访问升级为https访问了,

想到这个地方的接口还是http的,会不会block了

解决:

在页面中加入meta头

<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">

原文地址:https://www.cnblogs.com/qiujiababy/p/10142965.html