以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助]报错getCurExternalContact:fail_user not in allow list (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=159215) |
-- 作者:YOU -- 发布时间:2020/12/17 11:39:00 -- [求助]报错getCurExternalContact:fail_user not in allow list \'通过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)
|
-- 作者:有点蓝 -- 发布时间:2020/12/17 11:49:00 -- Dim agentid As String = "0" \'agentid id为0的应用没有权限访问这个用户
|