以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 企业微信通讯录改后如何应对呢 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=184760) |
-- 作者:chen_sheng -- 发布时间:2022/12/29 20:57:00 -- 企业微信通讯录改后如何应对呢 |
-- 作者:有点蓝 -- 发布时间:2022/12/29 21:25:00 -- 想表达什么问题? |
-- 作者:chen_sheng -- 发布时间: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\', |
-- 作者:有点蓝 -- 发布时间:2022/12/30 9:20:00 -- https://developer.work.weixin.qq.com/document/path/96079 |
-- 作者:chen_sheng -- 发布时间: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 [此贴子已经被作者于2022/12/30 9:38:40编辑过]
|
-- 作者:有点蓝 -- 发布时间: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,其实已经没有什么用了。官方的建议是自己建表管理通讯录
|