老师我修改了代码还是一样;Select Case e.path
Case "web"
If e.Request.HttpMethod = "GET" Then
Dim token = "eCIFS6iS3i9ACCcGBq" '必须和设置的Token相同
Dim signature As String = e.GetValues("signature")
Dim timestamp As String = e.GetValues("timestamp")
Dim nonce As String = e.GetValues("nonce")
Dim encrypt As String = e.PostValues("encrypt")
Dim jo As JObject = JObject.Parse(encrypt )
Dim ding As new DingTalkEncryptor("eCIFS6iS3i9ACC0PcGBq", "xlfwRsEMmY9wX2EJGKwAUTIx31oi9Koa", "dingdb4f91e09")
Dim res As String = ding.getDecryptMsg(signature , timestamp, nonce , encrypt)
msgbox(res) '显示解密的事件内容
'其它处理
Dim msg = ding.getEncryptedMap("success")
Dim po As New JObject
po("signature") = msg("signature")
po("timeStamp") = msg("timeStamp")
po("nonce") = msg("nonce")
po("encrypt") = msg("encrypt")
e.WriteString(po.ToString) '返回success的加密数据
End If
End Select
我这个服务端程序,除了上面的两段代码。就是开启服务在AfterOpenProject加了下面代码:
HttpServer.Prefixes.Add("http://*:8808/")
HttpServer.WebPath = "c:\web"
HttpServer.Start()
把这个程序发布后,放在服务器上。打开程序。然后点击钉钉的保存按钮。就HTTP请求结果校验返回字段值失败 HttpRequest: curl ;服务器端系统也没有msgbox弹出;
[此贴子已经被作者于2021/2/23 18:50:57编辑过]