设置授权链接的时候增加一个cookie,判断这个cookie是否有值,如果有说明拒绝
Else
dim a as string = e.Cookies("authorize")
if a = "1" then
With wb.AddMsgPage("","msgpage","请退出","您已拒绝授权,请关闭页面退出")
End With
e.WriteString(wb.Build)
return
end if
Dim wb As New weui
OpenID = e.Cookies("openid")
If userName = "" OrElse OpenID = "" Then
Dim ul1 As String = "https://open.weixin.qq.com/connect/oauth2/authorize?appid={0}&redirect_uri={1}&response_type=code&scope=snsapi_userinfo&state={2}#wechat_redirect"
Dim ul2 As String = UrlEncode("http://" & vars("域名") & "/" & url) '包装原基本URL
ul1 = CExp(ul1,vars("AppId"),ul2,"123")
wb.InsertHTML("<meta http-equiv='Refresh' c>") '跳转到授权链接
wb.AppendCookie("authorize","1")
e.WriteString(wb.Build)
Return ""
End If
End If