消息加解密设置的是 安全模式
请帮助
Dim e As RequestEventArgs = args(0) '网页函数开始
Dim dr1 As DataRow = DataTables("单位").Find("_Identify = " & e.Postvalues("id"))
If dr1 Is Nothing Then
Functions.Execute("error",e)
Return ""
End If
Dim url As String = "https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token={0}"
Dim hc As New HttpClient(CExp(url,Functions.Execute("GetAccessToken")))
Dim jo As New JObject
jo("expire_seconds") = 86400 '有效时间,单位为秒
jo("action_name") = "QR_SCENE" '类型为临时二维码
jo("action_info") = New JObject
jo("action_info")("scene") = New JObject
jo("action_info")("scene")("scene_id") = 112 '指定此二维码的场景ID
hc.Content = jo.ToString()
jo = JObject.Parse(hc.GetData)
If jo("errcode") Is Nothing Then
Dim dr As DataRow = DataTables("QRCode").Find("descripttion = '加入" & dr1("单位") & "申请'")
If dr Is Nothing Then
dr = DataTables("QRCode").AddNew()
End If
dr("Ticket") = jo("ticket")
dr("ExpireDate") = Date.Now .AddSeconds(jo("expire_seconds"))
dr("Descripttion") = "加入" & dr1("单位") & "申请"
dr.Save()
'https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=" & jo("ticket")
Else
MessageBox.Show(jo("errcode"))
End If
Dim wb As New weui '微信框架
wb.InsertHTML("<meta http-equiv='Refresh' c>") '直接跳转到首页
e.WriteString(wb.Build) '生成网页