Foxtable(狐表)用户栏目专家坐堂 → [求助]移动端问题


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

主题:[求助]移动端问题

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


加好友 发短信
等级:三尾狐 帖子:629 积分:4915 威望:0 精华:0 注册:2014/2/25 15:50:00
[求助]移动端问题  发帖心情 Post By:2017/6/22 10:29:00 [只看该作者]

有两个问题
1、网页的一个页面如何放到函数里面 该怎么调用
2、登录验证后如何跳转至需要访问的页面,而不是固定的访问首页

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


加好友 发短信
等级:超级版主 帖子:13837 积分:69650 威望:0 精华:0 注册:2016/11/1 14:42:00
  发帖心情 Post By:2017/6/22 10:37:00 [只看该作者]

1、 http://www.foxtable.com/mobilehelp/scr/0025.htm

 

2、加上网页的名跳转到登陆页,如 login.htm?key=list.htm

 

    或者是,设置好cookie以后,再跳转到登陆页。

 

    登陆成功后,获取list.htm 跳转

 

    跳转这样写代码 e.response.Redirect("新地址")


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


加好友 发短信
等级:三尾狐 帖子:629 积分:4915 威望:0 精华:0 注册:2014/2/25 15:50:00
  发帖心情 Post By:2017/6/22 14:50:00 [只看该作者]

请问第2个问题有例子吗 能给个简单的例子吗 谢谢

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


加好友 发短信
等级:超级版主 帖子:13837 积分:69650 威望:0 精华:0 注册:2016/11/1 14:42:00
  发帖心情 Post By:2017/6/22 15:28:00 [只看该作者]

 跳转之前加入代码

 

wb.AppendCookie("path", e.path) '将用

wb.InsertHTML("<meta http-equiv='Refresh' content='0; url=/logon.htm'>") '那么直接跳转到登录页面

 

 登陆成功后,跳转到这个页面 e.cookies("path")


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


加好友 发短信
等级:三尾狐 帖子:629 积分:4915 威望:0 精华:0 注册:2014/2/25 15:50:00
  发帖心情 Post By:2017/6/22 16:53:00 [只看该作者]

 If Verified Then
            UserID = Rand.NextString(16) '生成随机用户ID
            UserName = EncryptText(UserName,"123","123") '将用户名加密.
            Dim dr As DataRow = UserTable.Find("UserName = '" & UserName & "'")
            If  dr IsNot Nothing Then '如果是重复登录,删除以前的登录信息
                dr.Delete()
            End If
            dr = UserTable.AddNew()
            dr("UserName") = UserName
            dr("UserID") = UserId
            dr("ActiveTime") = Date.Now '记录登录时间
            wb.AppendCookie("username",UserName) '将用户名和密码写入cookie
            wb.AppendCookie("userid",UserID)
            wb.InsertHTML("<meta http-equiv='Refresh' c>") '直接跳转到首页
            e.WriteString(wb.Build) '生成网页
            Return '必须的
        End If
    End If
Else '其它页面从Cookie提取登录信息进行验证
    UserName = e.Cookies("username")  '从cookie中获取用户名
    UserID = e.Cookies("userid")  '从cookie中获取 随机ID
    Dim dr As DataRow = UserTable.Find("UserName = '" & UserName & "'")
    If dr IsNot Nothing AndAlso dr("UserID") = UserID Then  '如果通过验证,更新活动时候,继续访问其它页面.
        dr("ActiveTime") = Date.Now '更新活动时间
    Else '如果验证失败
wb.AppendCookie("path", e.path) '将用
        wb.InsertHTML("<meta http-equiv='Refresh' c>") '那么直接跳转到登录页面
        e.WriteString(wb.Build) '生成网页
        Return '必须的
    End If
End If

提示错误  第一段红色符号有误吗  这两段是加在这些位置吧


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


加好友 发短信
等级:超级版主 帖子:13837 积分:69650 威望:0 精华:0 注册:2016/11/1 14:42:00
  发帖心情 Post By:2017/6/22 17:43:00 [只看该作者]

If Verified Then
            UserID = Rand.NextString(16) '生成随机用户ID
            UserName = EncryptText(UserName,"123","123") '将用户名加密.
            Dim dr As DataRow = UserTable.Find("UserName = '" & UserName & "'")
            If  dr IsNot Nothing Then '如果是重复登录,删除以前的登录信息
                dr.Delete()
            End If
            dr = UserTable.AddNew()
            dr("UserName") = UserName
            dr("UserID") = UserId
            dr("ActiveTime") = Date.Now '记录登录时间
            wb.AppendCookie("username",UserName) '将用户名和密码写入cookie
            wb.AppendCookie("userid",UserID)
            msgbox(e.cookies("path"))

            wb.InsertHTML("<meta http-equiv='Refresh' content='0; url=/" & e.cookies("path") & "'>") 
            e.WriteString(wb.Build) '生成网页
            Return '必须的
        End If
    End If
Else '其它页面从Cookie提取登录信息进行验证
    UserName = e.Cookies("username")  '从cookie中获取用户名
    UserID = e.Cookies("userid")  '从cookie中获取 随机ID
    Dim dr As DataRow = UserTable.Find("UserName = '" & UserName & "'")
    If dr IsNot Nothing AndAlso dr("UserID") = UserID Then  '如果通过验证,更新活动时候,继续访问其它页面.
        dr("ActiveTime") = Date.Now '更新活动时间
    Else '如果验证失败

        wb.AppendCookie("path", e.path) '将用

        wb.InsertHTML("<meta http-equiv='Refresh' content='0; url=/logon.htm'>") '那么直接跳转到登录页面


        e.WriteString(wb.Build) '生成网页
        Return '必须的
    End If
End If

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


加好友 发短信
等级:三尾狐 帖子:629 积分:4915 威望:0 精华:0 注册:2014/2/25 15:50:00
  发帖心情 Post By:2017/6/23 10:05:00 [只看该作者]

老师你好,返回路径有了  但是我传递的参数没有了  就是网址htm后面?p.....这些没有,又没有办法一起传递呢

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


加好友 发短信
等级:超级版主 帖子:106356 积分:540921 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2017/6/23 10:44:00 [只看该作者]

......
Else '如果验证失败
    Dim url As String = e.path
    If e.GetValues.Count > 0 Then
        url &= "?"
        For Each key As String In e.GetValues.Keys
            url &= key & "=" & e.GetValues(key) & "&"
        Next
        url = url.TrimEnd("&")
    End If
    wb.AppendCookie("path", url) '将用
    wb.InsertHTML("<meta http-equiv='Refresh' c>") '那么直接跳转到登录页面
    
    e.WriteString(wb.Build) '生成网页
    Return '必须的
End If

 回到顶部