Foxtable(狐表)用户栏目专家坐堂 → 企业微信通讯录改后如何应对呢


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

主题:企业微信通讯录改后如何应对呢

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


加好友 发短信
等级:三尾狐 帖子:692 积分:6101 威望:0 精华:0 注册:2018/5/10 9:05:00
企业微信通讯录改后如何应对呢  发帖心情 Post By:2022/12/29 20:57:00 [只看该作者]


 回到顶部
帅哥,在线噢!
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:107740 积分:548039 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2022/12/29 21:25:00 [只看该作者]

想表达什么问题?

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


加好友 发短信
等级:三尾狐 帖子:692 积分:6101 威望:0 精华:0 注册:2018/5/10 9:05:00
  发帖心情 Post By:2022/12/30 9:16:00 [只看该作者]

新部署的云服务器  通讯录同步,增加企业可信IP后,企业微信报 出现48009错误如何可以解决呢

'Error-Code' => '48009',

'Error-Msg' => 'api forbidden for contact assistant, hint: [****], from ip: *.*.*.*, more info at https://open.work.weixin.qq.com/devtool/query?e=48009',


 回到顶部
帅哥,在线噢!
有点蓝
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:107740 积分:548039 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2022/12/30 9:20:00 [只看该作者]


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


加好友 发短信
等级:三尾狐 帖子:692 积分:6101 威望:0 精华:0 注册:2018/5/10 9:05:00
  发帖心情 Post By:2022/12/30 9:36:00 [只看该作者]

现在帮助的网页授权接口  示例对于新的云服务器来说已经失效了  目前在性能较差的服务器(一直持有)可以用,现在想弄到正式环境内该如何调整代码呢
Dim e As RequestEventArgs = args(0)
Dim url As String = e.path  'e.Request.url.tostring
        Dim g As String = ""
        For Each key As String In e.GetValues.Keys
            If g IsNot Nothing Then g = g & "&"
            g = g & key & "=" & e.GetValues(key)
        Next
        If g IsNot Nothing Then g = "?" & g  '解决苹果手机 通知信息会重置 用户帐号 导致无法获取用户的问题
        Dim jo As JObject
        Dim UserId As String = Nothing
        Dim UserInfo As String = Nothing
        Dim sb As New StringBuilder
        msgbox(url)
        If e.GetValues.ContainsKey("code") Then '如果通过授权链接跳转而来,就根据传递过来的code参数调用接口,获取用户的UserId
            Dim ul As String = "https://qyapi.weixin.qq.com/cgi-bin/user/getuserinfo?access_token={0}&code={1}"
                     "https://qyapi.weixin.qq.com/cgi-bin/user/list_id?access_token=ACCESS_TOKEN" 我看新的好像这样 该如何调整呢
            ul = CExp(ul, GetAccessToken, e.GetValues("code"))
            Dim hc As New HttpClient(ul)
            jo = JObject.Parse(hc.GetData)
            If jo("UserId") IsNot Nothing Then
                UserId = jo("UserId")
                UserInfo = GetUsers(jo("UserId"))
                e.AppendCookie("UserId", UserId) '用户userid存储在Cookie中
                e.AppendCookie("UserInfo", UserInfo) '用户信息存储在Cookie中
            End If
        Else
            If e.Cookies("UserId") IsNot Nothing And e.Cookies("UserInfo") IsNot Nothing Then
                UserId = e.Cookies("UserId")
                UserInfo = e.Cookies("UserInfo")
            Else
                Dim ul1 As String = "https://open.weixin.qq.com/connect/oauth2/authorize?appid={0}&redirect_uri={1}&response_type=code&scope=SCOPE&agentid=AGENTID&state=STATE#wechat_redirect"
                Dim CorpID As String = Functions.Execute("Get", "企业微信", 0) '企业号的CorpID
                Dim port As String = Nothing
                If Functions.Execute("Get", "基本信息", 1) <> 80 Then port = ":" & Functions.Execute("Get", "基本信息", 1)
                Dim kxym As String = Functions.Execute("Get", "基本信息", 2) & port  '域名+端口
                Dim ul2 As String = web.HttpUtility.UrlEncode("http://" & kxym & "/" & url & g)
                ul1 = CExp(ul1, CorpID, ul2)

                'msgbox(ul1)
                sb.Append("<meta http-equiv='Refresh' c>") '跳转到授权链接
                e.WriteString(sb.ToString)
                Return Nothing
            End If
        End If
        If UserId IsNot Nothing And UserInfo IsNot Nothing Then
            Return UserInfo
        End If
        Return Nothing
http://www.foxtable.com/mobilehelp/topics/0237.htm
[此贴子已经被作者于2022/12/30 9:38:40编辑过]

 回到顶部
帅哥,在线噢!
有点蓝
  6楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:107740 积分:548039 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2022/12/30 9:46:00 [只看该作者]

Dim ul As String = "https://qyapi.weixin.qq.com/cgi-bin/user/list_id?access_token={0}"
ul = CExp(ul, GetAccessToken)

新的接口只能获取成员ID,其实已经没有什么用了。官方的建议是自己建表管理通讯录

 回到顶部