下面代码报这个错
此主题相关图片如下:微信截图_20201217113642.png
'通过config接口注入权限验证配置
wb.AppendHTML("<script src='https://res.wx.qq.com/open/js/jweixin-1.2.0.js'></script>",True) '引入JS-SDK库
wb.AppendHTML("<script src='./JavaScript/ready.js'></script>") '引入脚本文件
Dim st As New Date(1970,1,1,8,0,0)
Dim appid As String = "wxba4d6cb0ad973e1a" 'CorpID
Dim timestamp As Integer = CInt((Date.Now - st).TotalSeconds()) '时间戳
Dim noncestr As String = Rand.NextString(16) '随机字符
Dim url As String = e.Request.URL.ToString '当前页面地址
Dim signature As String = Functions.Execute("GetQyJsSignature", noncestr, timestamp, url) '生成权限验证签名
Dim cfg As String = "wx.config({appId:'{0}',timestamp:{1},nonceStr:'{2}',signature:'{3}',jsApiList:['onHistoryBack','getContext','getNetworkType','getCurExternalContact','chooseImage']});"
wb.AppendHTML("<script>" & CExp(cfg,appid,timestamp,noncestr,signature) & "</script>",True)
'
'通过agentConfig注入应用的权限
wb.AppendHTML("<script src='https://open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js'></script>",True) '引入JS-SDK库
Dim corpid As String = "wxba4d6cb0ad973e1a" 'CorpID
Dim agentid As String = "0" 'agentid
Dim signatures As String = Functions.Execute("GetYyJsSignature", noncestr,timestamp,url) '生成权限验证签名
Dim cfgs As String = "wx.agentConfig({corpid: '{0}',agentid: '{1}',timestamp:{2},nonceStr: '{3}',signature: '{4}',jsApiList: ['getCurExternalContact'],success: function(res) {}});"
wb.AppendHTML("<script>" & CExp(cfgs,corpid,agentid,timestamp,noncestr,signatures) & "</script>",True)