Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共1 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:企业微信扫码的问题

1楼
HappyFt 发表于:2025/1/15 22:15:00
企业微信扫码录入类似下面生成签名的代码

2、新增一个自定义函数,函数名为"GetJsSignature",用于生成JS-SDK的授权签名,代码为:

Static CreateTime As Date '记录最近一次生成Ticket 的时间
Static
Ticket As String '记录最近一次生成的Ticket
Dim
tp As TimeSpan = Date.Now - CreateTime
Dim
ul As String = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token={0}&type=jsapi"
If
tp.TotalSeconds > 3600 Then
    Dim hc As New HttpClient(CExp(ul,Functions.Execute("GetAccessToken")))
    Dim ret As String = hc.GetData()
    If ret = "" Then
'
如果失败,再尝试一次
        hc.GetData()
    End If
    CreateTime = Date.Now()
    Dim jo As JObject = JObject.Parse(ret)
    If jo("errcode") = "0" Then
        Ticket = jo("ticket")
    Else
        MessageBox.show(
"
获取jsapi_ticket,原因:" & vbcrlf & jo.ToString)
    End
If

End
If
Dim
signature As String = CExp("jsapi_ticket={0}&noncestr={1}&timestamp={2}&url={3}",Ticket,args(0),args(1),args(2))
Return
Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(signature, "SHA1").ToLower()


当域名访问用非80端口时就会出现40093的签名错误,请问加了其他端口要怎么处理才不出错

谢谢!

共1 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .03223 s, 2 queries.