Foxtable(狐表)用户栏目专家坐堂 → [求助]报错getCurExternalContact:fail_user not in allow list


  共有4922人关注过本帖树形打印复制链接

主题:[求助]报错getCurExternalContact:fail_user not in allow list

帅哥哟,离线,有人找我吗?
YOU
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:小狐 帖子:395 积分:633 威望:0 精华:0 注册:2018/3/5 14:40:00
[求助]报错getCurExternalContact:fail_user not in allow list  发帖心情 Post By:2020/12/17 11:39:00 [只看该作者]

下面代码报这个错
图片点击可在新窗口打开查看此主题相关图片如下:微信截图_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)

 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:111393 积分:567029 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/12/17 11:49:00 [只看该作者]

Dim agentid As String = "0" 'agentid

id为0的应用没有权限访问这个用户

图片点击可在新窗口打开查看此主题相关图片如下:1.png
图片点击可在新窗口打开查看


 回到顶部