Foxtable(狐表)用户栏目专家坐堂 → 主页跳转问题


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

主题:主页跳转问题

帅哥,在线噢!
ycs5801
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:四尾狐 帖子:965 积分:6933 威望:0 精华:0 注册:2009/6/24 9:44:00
主页跳转问题  发帖心情 Post By:2024/1/26 9:40:00 [只看该作者]

zdzs函数内容:
Dim e As RequestEventArgs = args(0) 
Dim wb As New weui

If e.Request.Headers("User-Agent").ToLower.Contains("micromessenger") Then
    Dim openid As String
    Dim dropenid As DataRow
    openid = Functions.Execute("getopenid", e) '提取用户openid
    If openid <> "" Then '假如提取到openid
'        messagebox.Show("1")
        dropenid = DataTables("登录用户").sqlfind("openid='" & openid & "'") '在登录用户表中查找此openid  
    End If
'    messagebox.Show("2")
    
    If  dropenid IsNot Nothing Then '如果找到了用户的openid  
'        messagebox.Show("3")
        wb.AppendCookie("用户姓名", dropenid("用户姓名")) '将用户名信息写入cookie
        wb.AppendCookie("用户密码", dropenid("用户密码"))
       
    End If 
    
ElseIf e.Cookies.ContainsKey("用户姓名") And e.Cookies.ContainsKey("用户密码") Then
    Dim dr As DataRow = DataTables("登录用户").sqlfind("用户姓名='" & e.Cookies("用户姓名") & "'")
    If dr Is Nothing OrElse dr("用户密码") <> e.Cookies("用户密码") Then '''如果无此用户,或密码不正确.
        wb.InsertHTML("<meta http-equiv='Refresh' c>")
        e.WriteString(wb.Build)
        Return""
    End If
Else
    wb.InsertHTML("<meta http-equiv='Refresh' c>")
    e.WriteString(wb.Build)
    Return""

End If

If e.GetValues.ContainsKey("name") Then
zdzs页面内容......
end if

现在通过http://cbjg.740700.xyz/zdzs.htm?name=1557 这个网址调用这个页面,在pc浏览器可以直接打开对应的zdzs页面内容,但是在微信浏览器中则自动跳转到了http://cbjg.740700.xyz/default.htm页面了
请问哪里出错了?

 回到顶部
帅哥,在线噢!
cd_tdh
  2楼 | QQ | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:狐精 帖子:3088 积分:20626 威望:0 精华:0 注册:2016/3/28 16:57:00
  发帖心情 Post By:2024/1/26 9:47:00 [只看该作者]

http://www.foxtable.com/mobilehelp/topics/0245.htm

 回到顶部
帅哥,在线噢!
ycs5801
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:四尾狐 帖子:965 积分:6933 威望:0 精华:0 注册:2009/6/24 9:44:00
  发帖心情 Post By:2024/1/26 9:54:00 [只看该作者]

  If dr2("openid") <> "" Then '推送公众号
                            Dim url As String = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token={0}"
                            Dim hc As New HttpClient(CExp(url, Functions.Execute("GetAccessToken")))
                            Dim jo As New JObject
                            Dim ja As New JArray
                            jo("touser") = CStr(dr2("openid"))
                            jo("template_id") = "k16d8RCZCzoR4" '模板ID
                            jo("url") = "cbjg.740700.xyz/zdzs.htm?name=" & CStr(dr("_Identify")) '打开折叠信息页面,传递主键
                            jo("data") = New JObject()

网址链接是通过这个微信公众号的地址推送的

 回到顶部
帅哥,在线噢!
有点蓝
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:107029 积分:544376 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2024/1/26 10:09:00 [只看该作者]

把前前后后的完整代码放到记事本发上来

 回到顶部
帅哥,在线噢!
ycs5801
  5楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:四尾狐 帖子:965 积分:6933 威望:0 精华:0 注册:2009/6/24 9:44:00
记事本  发帖心情 Post By:2024/1/26 10:23:00 [只看该作者]


以下内容是专门发给有点蓝浏览



 回到顶部
帅哥,在线噢!
有点蓝
  6楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:107029 积分:544376 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2024/1/26 10:39:00 [只看该作者]

调试

zdzs函数:
Dim e As RequestEventArgs = args(0) 
Dim wb As New weui
msgbox(e.Request.Headers("User-Agent"))
If e.Request.Headers("User-Agent").ToLower.Contains("micromessenger") Then
    Dim openid As String
    Dim dropenid As DataRow
    openid = Functions.Execute("getopenid", e) '提取用户openid
msgbox("openid=" & openid)
    If openid <> "" Then '假如提取到openid
'        messagebox.Show("1")
        dropenid = DataTables("登录用户").sqlfind("openid='" & openid & "'") '在登录用户表中查找此openid  
    End If
'    messagebox.Show("2")
 msgbox("dropenid=" & (dropenid IsNot Nothing))   
    If  dropenid IsNot Nothing Then '如果找到了用户的openid  
'        messagebox.Show("3")
        wb.AppendCookie("用户姓名", dropenid("用户姓名")) '将用户名信息写入cookie
        wb.AppendCookie("用户密码", dropenid("用户密码"))
        wb.AppendCookie("用户类别", dropenid("用户类别"))
        wb.AppendCookie("用户单位", dropenid("用户单位"))
        wb.AppendCookie("用户账号", dropenid("用户账号"))
        wb.AppendCookie("用户级别", dropenid("用户级别"))
        wb.AppendCookie("手机号", dropenid("手机号"))
        wb.AppendCookie("邮箱地址", dropenid("邮箱地址"))
    End If 
    
ElseIf e.Cookies.ContainsKey("用户姓名") And e.Cookies.ContainsKey("用户密码") Then
msgbox("用户姓名")
    Dim dr As DataRow = DataTables("登录用户").sqlfind("用户姓名='" & e.Cookies("用户姓名") & "'")
    If dr Is Nothing OrElse dr("用户密码") <> e.Cookies("用户密码") Then '''如果无此用户,或密码不正确.
        wb.InsertHTML("<meta http-equiv='Refresh' c>")
        e.WriteString(wb.Build)
        Return""
    End If
Else
msgbox("logon.htm")
    wb.InsertHTML("<meta http-equiv='Refresh' c>")
    e.WriteString(wb.Build)
    Return""

End If

msgbox("name=" & e.GetValues.ContainsKey("name") )

 回到顶部
帅哥,在线噢!
ycs5801
  7楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:四尾狐 帖子:965 积分:6933 威望:0 精华:0 注册:2009/6/24 9:44:00
  发帖心情 Post By:2024/1/26 10:55:00 [只看该作者]

图片添加不上来了,我手敲吧,第一个是浏览器信息,第二个是openid=,第三个是dropenid=false,后边就没有了。这么看openid没有获取到啊

 回到顶部
帅哥,在线噢!
有点蓝
  8楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:107029 积分:544376 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2024/1/26 10:57:00 [只看该作者]

学会发图:http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&Id=78

openid=后面没有东西就是没有获取到

 回到顶部
帅哥,在线噢!
ycs5801
  9楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:四尾狐 帖子:965 积分:6933 威望:0 精华:0 注册:2009/6/24 9:44:00
  发帖心情 Post By:2024/1/26 11:00:00 [只看该作者]

附加
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:pic.rar


 回到顶部
帅哥,在线噢!
ycs5801
  10楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:四尾狐 帖子:965 积分:6933 威望:0 精华:0 注册:2009/6/24 9:44:00
  发帖心情 Post By:2024/1/26 11:05:00 [只看该作者]

其它地方可以直接    openid = Functions.Execute("getopenid", e) '提取用户openid,这个为什么不行呢?


 回到顶部
总数 38 1 2 3 4 下一页