Foxtable(狐表)用户栏目专家坐堂 → 微信公众号测试提价token重提示 URL超时


  共有2339人关注过本帖树形打印复制链接

主题:微信公众号测试提价token重提示 URL超时

帅哥哟,离线,有人找我吗?
lemonkashi
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:童狐 帖子:215 积分:1664 威望:0 精华:0 注册:2017/9/26 13:40:00
微信公众号测试提价token重提示 URL超时  发帖心情 Post By:2020/4/13 11:32:00 [显示全部帖子]

微信公众号测试提价token重提示 请求URL超时

服务器端代码如下:
Select Case e.path
    Case "wefox" ,"wefox1"
        Dim token = "weixinlemon" '必须和设置的Token相同
        'messagebox.Show("weixinlemon")
        Dim signature As String = e.Values("signature")
        Dim timestamp As String = e.Values("timestamp")
        Dim nonce As String = e.Values("nonce")
        Dim echostr As String = e.Values("echostr")
        Dim aryTmp() As String = {token,timestamp,nonce}
        Array.Sort(aryTmp)
        Dim strTmp As String = String.Join("", aryTmp)
        strTmp = Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(strTmp, "SHA1")
        If signature = strTmp.ToLower() Then
              e.WriteString(echostr)
        End If
End Select


查看了一下微信帮助文档 写的如下

private function checkSignature()
{
    $signature = $_GET["signature"];
    $timestamp = $_GET["timestamp"];
    $nonce = $_GET["nonce"];
	
    $token = TOKEN;
    $tmpArr = array($token, $timestamp, $nonce);
    sort($tmpArr, SORT_STRING);
    $tmpStr = implode( $tmpArr );
    $tmpStr = sha1( $tmpStr );
    
    if( $tmpStr == $signature ){
        return true;
    }else{
        return false;
    }
}

 需要将  e.WriteString(echostr) 改成  return true; ?


找不到原因了  请蓝老师指点  谢谢。


 回到顶部
帅哥哟,离线,有人找我吗?
lemonkashi
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:童狐 帖子:215 积分:1664 威望:0 精华:0 注册:2017/9/26 13:40:00
  发帖心情 Post By:2020/4/13 12:00:00 [显示全部帖子]

外放可以访问这个服务器,我一直在远程登录这个电脑。访问http://www.clouddoctor.club/wefox 测试连通的。

 回到顶部
帅哥哟,离线,有人找我吗?
lemonkashi
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:童狐 帖子:215 积分:1664 威望:0 精华:0 注册:2017/9/26 13:40:00
  发帖心情 Post By:2020/4/13 12:02:00 [显示全部帖子]


[此贴子已经被作者于2020/4/13 13:15:28编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
lemonkashi
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:童狐 帖子:215 积分:1664 威望:0 精华:0 注册:2017/9/26 13:40:00
  发帖心情 Post By:2020/4/13 12:15:00 [显示全部帖子]

服务器端代码就是这些 基本是在帮助文档里面贴出来的
Select Case e.path
    Case "wefox" ,"wefox1"
        Dim token = "weixinlemon" '必须和设置的Token相同
        'messagebox.Show("weixinlemon")
        Dim signature As String = e.Values("signature")
        Dim timestamp As String = e.Values("timestamp")
        Dim nonce As String = e.Values("nonce")
        Dim echostr As String = e.Values("echostr")
        Dim aryTmp() As String = {token,timestamp,nonce}
        Array.Sort(aryTmp)
        Dim strTmp As String = String.Join("", aryTmp)
        strTmp = Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(strTmp, "SHA1")
        If signature = strTmp.ToLower() Then
              e.WriteString(echostr)              
        End If
End Select

 回到顶部
帅哥哟,离线,有人找我吗?
lemonkashi
  5楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:童狐 帖子:215 积分:1664 威望:0 精华:0 注册:2017/9/26 13:40:00
  发帖心情 Post By:2020/4/13 13:17:00 [显示全部帖子]

刚刚反复测试 一下突然又行了,不知道是不是微信配置界面每次提交都要先刷新的事情。

 回到顶部