以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  企业微信授权访问遇到难题了  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=133896)

--  作者:yellow
--  发布时间:2019/4/23 11:56:00
--  企业微信授权访问遇到难题了
按照教程实现了企业微信授权访问,能正常运行。但有些时候,通过超链接的访问需要访问两次才会成功。怎样才能一次就成功访问到指定记录?
访问的超链接示例如下:

http://www.gongwen.com/list.htm?k=1&v=3

HTTPRequest 代码如下:

        If Functions.Execute("Permit",e,"xxxxxxxxxxxxx","http://www.gongwen.com/","123") = False Then \'授权访问
            Dim sb As New StringBuilder
            sb.AppendLine("你无权访问本系统")
            e.WriteString(sb.ToString)
        Else
            Select Case e.Path
                Case "home.htm"
                    \'默认页面
                    Functions.Execute("home",e)
                Case "addnew.htm"
                    \'递交新的公文
                    Functions.Execute("addnew",e)
                Case "list.htm"
                    \'公文详情
                    Functions.Execute("list",e)
            Case Else
                Dim sb As New StringBuilder
                sb.AppendLine("有异常情况!请重新再打开一次")
                e.WriteString(sb.ToString)
        End Select

Permit等函数也是抄教程代码的。


--  作者:有点甜
--  发布时间:2019/4/23 12:05:00
--  

加入比如红色代码

 

Functions.Execute("list",e)

return


--  作者:有点甜
--  发布时间:2019/4/23 12:08:00
--  

 

通过超链接访问后,跳转到了哪里?如何重新访问后正常?请具体说明。

 

 


--  作者:yellow
--  发布时间:2019/4/23 15:31:00
--  
以 http://www.gongwen.com/list.htm?k=1&v=3 为例,一般是访问到list函数所设计的页面,根据k、v两个参数确定显示哪条记录。现在的问题是,一些人收到超链接,点击访问后,第一次是访问到 http://www.gongwen.com/ 。再次点击链接才能访问到list.htm页面。


--  作者:有点甜
--  发布时间:2019/4/23 16:26:00
--  

你跳转的代码有问题。请动态合成需要跳转过去的地址

 

msgbox(UrlEncode(e.Request.URL.ToString))

 

Dim ul As String = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxd0106a49b1e546b4&redirect_uri=" & UrlEncode(e.Request.URL.ToString) & "&response_type=code&scope=snsapi_base&state=123#wechat_redirect"


--  作者:yellow
--  发布时间:2019/4/23 17:00:00
--  
好的,谢谢!