按照教材中微信菜单接口->用数据表管理多个菜单来创建个性化菜单,程序片断如下.红色语句那一行拼接的问题。
出现了40054错误. 查了一下好象说的是Ur的格式不对.可是反复的验证,甚至用微信平台说明比对,都没有发现问题.
验证Token没有错误。
怎么查找?谢谢
......
MO("button") = FButtons
If MenuRow.IsNull("matchrule") = False '如果设置了过滤条件,那就是个性化菜单了
Dim FO As New JObject
Dim fts() As String = MenuRow("matchrule").Split("&")
For Each ft As String In fts
Dim kv() As String = ft.Split("=")
FO(kv(0)) = kv(1)
Next
MO("matchrule") = FO
ur = "https://api.weixin.qq.com/cgi-bin/menu/addconditional?access_token={0}"
Else
ur = "https://api.weixin.qq.com/cgi-bin/menu/create?access_token={0}"
End If
Dim urx As String=CExp(ur,Functions.Execute("GetAccessToken"))
hc = New HttpClient(urx)
hc.Content = MO.ToString()
RO = JObject.Parse(hc.GetData)
If RO("menuid") IsNot Nothing Then
menuRow("MenuID") = RO("menuid")
ElseIf RO("errcode") <> "0" Then
Dim su As Row=Tables("操作记录").AddNew
su("数据来源")="AddMune1"
su("时间戳")=Date.now
su("信息2")=urx
su.save
MessageBox.Show("X00101 " & RO("errcode").Tostring)
End If
......