Foxtable(狐表)用户栏目专家坐堂 → 为什么用安卓手机的微信浏览器打开网页会自动打开两次


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

主题:为什么用安卓手机的微信浏览器打开网页会自动打开两次

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2019/5/6 13:04:00 [只看该作者]

 

我用uc浏览器测试没问题。请换一个浏览器,换一台手机,换一个网络,然后测试。

 

 


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


加好友 发短信
等级:童狐 帖子:277 积分:2400 威望:0 精华:0 注册:2015/12/11 4:29:00
  发帖心情 Post By:2019/5/6 13:19:00 [只看该作者]

谢谢老师!

没有特别的步骤,就随便点会出现.电脑测试目前也没有发现

现在加了Try的代码

是这样加的么

 

 
以下内容为程序代码:

1 Try
2 Static UserTable As DataTable '定义一个变量,用于存储用户随机身份ID,以及最后一次活动时间.
3 Static ClearTime As Date
4 If UserTable Is Nothing Then '创建用于记录登录信息的临时表
5 ClearTime = Date.Now()
6 Dim dtb As New DataTableBuilder("UserInfos")
7 dtb.AddDef("UserName", Gettype(String), 16)
8 dtb.AddDef("UserID",Gettype(String),16)
9 dtb.AddDef("ActiveTime",Gettype(Date))
10 UserTable = dtb.Build(True)
11 End If
12 If (Date.Now - ClearTime).Totaldays >= 3 Then '清除超过3天没有操作的登录信息
13 UserTable.DeleteFor("ActiveTime < #" & Date.Now.AddDays(-3) & "#")
14 ClearTime = Date.Now()
15 End If
16 Dim wb As New weui
17 '身份验证
18 Dim UserName As String
19 Dim Password As String
20 Dim UserID As String
21
22 If e.Path = "logon.htm" '验证用户名和密码
23 If e.PostValues.ContainsKey("username") And e.PostValues.ContainsKey("password") Then
24 Dim Verified As Boolean '用于标记用户是否通过了身份验证
25 UserName = e.PostValues("username")
26 Password = e.PostValues("password")
27 ' MessageBox.Show(10)
28 Dim mm3 As String = EncryptText(Password,"125","128") '加密字符在用户表中进行比较
29 Dim drm As DataRow = DataTables("员工资料表").Find("姓名='" & UserName & "'") '
30 If drm IsNot Nothing Then '存在用户
31 If drm("mm")= mm3 Then
32 Verified = True
33
34 End If
35 End If
36
37 If Verified Then
38 UserID = Rand.NextString(16) '生成随机用户ID
39 UserName = EncryptText(UserName,"125","128") '将用户名加密.
40 Dim dr As DataRow = UserTable.Find("UserName = '" & UserName & "'")
41 If dr IsNot Nothing Then '如果是重复登录,删除以前的登录信息
42 dr.Delete()
43 End If
44 dr = UserTable.AddNew()
45 dr("UserName") = UserName
46 dr("UserID") = UserId
47 dr("ActiveTime") = Date.Now '记录登录时间
48 wb.AppendCookie("username",UserName) '将用户名和密码写入cookie
49 wb.AppendCookie("userid",UserID)
50 ' MessageBox.Show(11)
51 wb.InsertHTML("<meta http-equiv='Refresh' c>") '直接跳转到首页
52 e.WriteString(wb.Build) '生成网页
53 Return '必须的
54 End If
55 End If
56 Else If e.Path = "zhuce.htm"
57 ' MessageBox.Show(40)
58 If e.PostValues.count = 0 Then
59 wb.AddPageTitle("","pageheader","注册用户","")
60 wb.AddForm("","form1","zhuce.htm")
61 With wb.AddInputGroup("form1","ipg1","")
62 With .AddSelect("xm","姓名","|"+DataTables("员工资料表").GetComboListString("姓名","绩效工资=true","[_Identify]"))
63 End With
64 .AddInput("mm","密码","password").Placeholder = "请输入6位数密码"
65 .AddInput("mm1","密码","password").Placeholder = "请再次输入6位数密码"
66 End With
67 With wb.AddButtonGroup("form1","btg1",True)
68 .Add("btn1", "确定", "submit")
69 .Add("btn1", "返回登录","","logon.htm").Kind = 1
70 End With
71 e.WriteString(wb.Build) '生成网页
72 Else '接收保存数据
73 If e.PostValues.ContainsKey("mm") AndAlso e.PostValues.ContainsKey("mm1") AndAlso e.PostValues.ContainsKey("xm") Then
74 If e.PostValues("mm") = e.PostValues("mm1") Then
75 Dim dr As DataRow = DataTables("员工资料表").Find("姓名 = '" & e.PostValues("xm") & "' and mm is null")
76 Dim mm2 As String = EncryptText(e.PostValues("mm"),"125","128")
77 If dr IsNot Nothing Then
78 dr("mm") = mm2
79 dr.Save()
80 With wb.AddMsgPage("","msgpage","注册成功请登录!","")
81 .AddButton("btn1","确定","logon.htm")'然后直接跳转到注册页面
82 End With
83 ' wb.InsertHTML("<meta http-equiv='Refresh' c>") '然后直接跳转到登录页面
84 Else
85 With wb.AddMsgPage("","msgpage","已注册,重置密码请联系阳海雄!","")
86 .Icon="warn"
87 .AddButton("btn1","确定","zhuce.htm")'然后直接跳转到注册页面
88 End With
89 ' wb.InsertHTML("<meta http-equiv='Refresh' c>") '然后直接跳转到登录页面
90 End If
91 Else
92 With wb.AddMsgPage("","msgpage","两次密码不相同!","")
93 .Icon="warn"
94 .AddButton("btn1","确定","zhuce.htm")'然后直接跳转到注册页面
95 End With
96 End If
97 Else
98 With wb.AddMsgPage("","msgpage","请输入完整 姓名:密码:二次密码!","")
99 .Icon="warn"
100 .AddButton("btn1","确定","zhuce.htm")'然后直接跳转到注册页面
101 End With
102 End If
103 ' wb.InsertHTML("<meta http-equiv='Refresh' c>") '然后直接跳转到注册页面
104 e.WriteString(wb.Build) '生成网页
105 Return '必须的
106 End If
107
108
109
110 Else '其它页面从Cookie提取登录信息进行验证
111 UserName = e.Cookies("username") '从cookie中获取用户名
112 UserID = e.Cookies("userid") '从cookie中获取 随机ID
113 Dim dr As DataRow = UserTable.Find("UserName = '" & UserName & "'")
114 If dr IsNot Nothing AndAlso dr("UserID") = UserID Then '如果通过验证,更新活动时候,继续访问其它页面.
115 dr("ActiveTime") = Date.Now '更新活动时间
116 Else '如果验证失败
117 wb.InsertHTML("<meta http-equiv='Refresh' c>") '那么直接跳转到登录页面
118 e.WriteString(wb.Build) '生成网页
119 Return '必须的
120 End If
121 End If
122
123
124 Select Case e.Path
125 Case "", "default.htm" '首页
126 'MessageBox.Show(0)
127 Functions.Execute("default",e)
128
129 Case "logon.htm" '登录页面
130 'MessageBox.Show(1)
131 Functions.Execute("logon",e)
132
133 Case "exit.htm" '退出登录页
134 'MessageBox.Show(2)
135 wb.DeleteCookie("username") '清除cookie中原来的用户名和密码
136 wb.DeleteCookie("password")
137 wb.InsertHTML("<meta http-equiv='Refresh' c>") '然后直接跳转到登录页面
138 e.WriteString(wb.Build) '生成网页
139 Case "list.htm" '列表页
140 Functions.Execute("List",e)
141
142 Case "addnew.htm" '新增生产日报表页
143 Functions.Execute("AddNew",e)
144 Case "getCodes.htm" '生产日报表页获取产品名称自动输入用
145 Functions.Execute("getCodes",e)
146
147 Case "getTimes.htm" '获取上次机器时间''getCounties.htm'getBrands.htm
148 ' MessageBox.Show(0)
149 Functions.Execute("getTimes",e)'
150
151 Case "getBrands.htm" '获取工序名称项目列表''getCounties.htm'getBrands.htm
152 Functions.Execute("getBrands",e)
153
154 Case "receive.htm" '保存日报表提交数据
155 Functions.Execute("receive",e)
156 Case "valid.htm"
157 Functions.Execute("valid",e) '验证提交数据和机器时间格式是否正确
158
159 Case "edit.htm" '报表编辑页
160 ' MessageBox.Show(1)
161 Functions.Execute("Edit",e)
162 Case "delete.htm" '报表删除页
163 Functions.Execute("Delete",e)
164 Case "xscg.htm"
165 Functions.Execute("xscg",e) '显示成功
166 Case "slcx.htm"
167 Functions.Execute("slcx",e) '显示成功
168 Case "slcxjg.htm"
169 Functions.Execute("slcxjg",e) '显示成功
170 Case "pmcx.htm"
171 Functions.Execute("pmcx",e) '显示成功
172 Case "pmcxjg.htm"
173 Functions.Execute("pmcxjg",e) '显示成功
174 'e.WriteString(wb.Build) '生成网页
175 End Select
176 Catch ex As Exception
177 Functions.Execute("logText",ex)
178 End Try
179
180
181

 

 

函数:LogText

Dim v  = Args(0)
Dim msg As String
If Typeof v Is Exception Then '如果是Exception的异常类型,则递归获取所有的异常堆栈
    Do While v IsNot Nothing
        msg &= v.Message &  vbcrlf & v.StackTrace & vbcrlf
        v = v.InnerException
    Loop
Else '其它情况只能传入错误的文本内容
    msg = v
End If
Output.Logs("AppLogging").Add(Format( Date.Now,"yyyy-MM-dd HH:mm:ss.ffff") & vbCrLf & msg)
Output.Logs("AppLogging").Save(ProjectPath & "Mmsglog.txt",True) '日志位于当前项目目录里
Output.Logs("AppLogging").Clear

[此贴子已经被作者于2019/5/6 19:05:05编辑过]

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2019/5/6 16:13:00 [只看该作者]

以下是引用ouyangfenghuan在2019/5/6 13:19:00的发言:

谢谢老师!

没有特别的步骤,就随便点会出现.电脑测试目前也没有发现

现在加了Try的代码

是这样加的么

 

 

 

小米手机自带的浏览器,有可能有问题,你试试换一台手机,换一种浏览器测试。

 


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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2019/5/6 16:14:00 [只看该作者]

 

try catch 加在顶部和尾部,即可。

 

 


 回到顶部
总数 34 上一页 1 2 3 4