-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdotindex.html
More file actions
465 lines (387 loc) · 14.8 KB
/
dotindex.html
File metadata and controls
465 lines (387 loc) · 14.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
<!DOCTYPE>
<html lang="en">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta charset="utf-8" />
<title>PortalWeb</title>
<meta name="description" content="" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
<link rel="stylesheet" href="css/bootstrap.min.css" />
<link rel="stylesheet" href="css/muyi.css" />
<link rel="stylesheet" href="css/font-awesome.min.css" type="text/css">
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/md5.min.js"></script>
<script type="text/javascript" src="js/wechatutil.js"></script>
</head>
<style>
html,
body {
font-family: Reeji-CloudYuanZhun-GBK, Tahoma, Helvetica, Arial, Verdana, "Microsoft YaHei", "SimSun", "宋体", serif;
-webkit-overflow-scrolling: touch;
user-select: none;
background: #fff;
height: 100%;
}
body.safari {
height: calc(100vh - 75px);
}
body.safari section:first-child {
height: calc(45vh - 75px) !important;
}
@font-face {
font-family: Reeji-CloudYuanZhun-GBK;
src: url('fonts/dotminifont.ttf');
}
body {
display: flex;
flex-direction: column;
justify-content: space-around;
}
input {
-webkit-appearance: none !important;
outline: none;
border: none;
background: #fff;
padding: 0;
}
button {
-webkit-appearance: none !important;
background: #fff;
border: 0;
font-size: 3.5vw;
}
.inputbtn {
height: 6vh;
border-radius: 6vh;
border: 2px solid #7AC28A;
}
.inputbtngroup {
position: relative;
display: flex;
align-items: center;
justify-content: space-between;
margin: 3vw 0;
}
.inputbtngroup .inputbtn {
display: inline-block;
}
.phone:before {
content: '';
background-size: auto;
position: absolute;
left: 6vw;
width: 4vw;
height: 3vh;
background: url(img/phone.svg) no-repeat center;
}
.lock:before {
content: '';
background-size: auto;
position: absolute;
left: 6vw;
width: 4vw;
height: 3vh;
background: url(img/lock.svg) no-repeat center;
}
#getmsgbtn {
position: absolute;
right: 0;
height: calc(6vh - 4px);
top: 0;
border-radius: 6vh;
margin: 2px;
padding: 0 5vw;
width: calc(32vw - 4px);
text-align: center;
letter-spacing: 0.2em;
text-indent: 0.2em;
line-height: 6vh;
color: #666;
}
#getmsgbtn:active {
background: #E0E0E0;
}
#getmsgbtn:disabled:active {
background: #fff;
}
#getmsgbtn:before {
content: '';
position: absolute;
left: 0;
height: 3vh;
width: 1px;
background: #666;
top: 0.9vh;
}
#loginbtn {
width: 35%;
background: #7AC28A;
text-align: center;
letter-spacing: 0.5em;
text-indent: 0.5em;
line-height: 6vh;
color: #fff;
}
#loginbtn:active {
background: #52a59f !important;
}
#loginbtn:disabled:active {
background: #7AC28A !important;
}
#wxbtn:active,
#mailbtn:active {
background: #E0E0E0;
border-radius: 50%;
}
/*.banner {*/
/* position: absolute;*/
/*}*/
</style>
<body style="overflow: hidden;">
<section style="height: 45vh;overflow: hidden;">
<div class="carousel slide" data-ride="carousel">
<div class="carousel-inner" id="banners"></div>
</div>
</section>
<img src="./img/logo.svg" style="height: 7vh;margin: 3vh auto;display: block;" alt="logo">
<div style="margin: 1.5vh auto;color:#000;font-size: 4.5vw;letter-spacing:0.2em;text-align: center;">逗号立方购物公园欢迎您
</div>
<div style="width:75vw;margin: 1vw auto;font-size: 4.2vw;" id="main">
<div style="height: 10px;margin-top: 4px;margin-bottom: 10px;padding-left: 10px;color: red;font-size: 2.3vw;">
<label id="errMessage"></label>
</div>
<div id="inputbox">
<div class="inputbtngroup phone">
<input class="inputbtn" type="tel" name="phone" id="phoneinput" maxlength="11" oninput="authPhone()"
style="width: 100%;padding-left: 14vw;padding-right: 31vw;">
<button type="button" id="getmsgbtn" name="getSMS" onclick="getSMS()">获取短信</button>
</div>
<div class="inputbtngroup lock">
<input class="inputbtn" type="tel" name="authCode" id="codeinput" maxlength="6"
style="width: 62%;padding-left: 14vw;">
<button type="button" id="loginbtn" class="inputbtn" onclick="login(1)">登录</button>
</div>
</div>
<div id="inputresult" style="display: none">
<div
style="margin: 3vw auto;color:#fff;font-size: 3.7vw;letter-spacing:0.2em;text-align: center;line-height: 1.5em">
登录成功<br>正在跳转。。。
</div>
</div>
</div>
<div style="display:none;justify-content: center;margin:5vw;font-size: 3vw;">
<div style="height: 10vw;margin:0 5vw;">
<img src="./img/wx.svg" id="wxbtn" onclick="login(2)" style="height: 8vw;" alt="wx">
<div style="text-align: center;color:#666;margin: 0.3em 0;letter-spacing: 0.1em;">微信</div>
</div>
<div style="height: 10vw;margin:0 5vw;">
<img src="./img/mail.svg" id="mailbtn" style="height: 8vw;" alt="mail">
<div style="text-align: center;color:#666;margin: 0.3em 0;letter-spacing: 0.1em;">短信</div>
</div>
</div>
<div style="margin: 7vw auto;color:#666;font-size: 3vw;text-align: center;letter-spacing: 0.1em;margin-top: 12%;">
欢迎使用逗号立方无线网络
</div>
<img src="./img/bottom.svg" style="object-fit: cover;">
</body>
</html>
<script type="text/javascript">
// if (isSafari) {
// alert(window.screen.availHeight + '--' + window.innerHeight + '--' + window.outerHeight + '--' + document.body.clientHeight)
// $('body').addClass('safari')
// }
// function isSafari() {
// return /Safari/.test(navigator.userAgent) && !/Chrome/.test(navigator.userAgent) && /Mobile/.test(navigator.userAgent)
// }
var data = "";
var second = 60;
var paraString;
var phone;
var paraDict = new Object();
var macTrigger = '<div style="width: 65%;margin:1.5em auto;line-height: 1.6em;font-size:14px;text-align: center;margin-top: 30px;">' +
' <i class="fa fa-check fa-4x" style="color: green;display: inline-block;vertical-align: middle;"></i>' +
' <p style="color: green;font-size: 26px;margin-top: 20px;" name="macTriggerText">您已认证成功!</p>' +
' <p style="color: black;font-size: 18px;margin-top: 20px;" name="skip">正在跳转...</p>' +
'</div>';
function authPhone() {
var myreg = /^1[3|4|5|7|8][0-9]{9}$/;
phone = $('[name="phone"]').val();
console.log(phone)
$('[name="getSMS"]').prop('disabled', !myreg.test(phone));
}
function getSMS() {
if (null == paraDict["userip"] || null == paraDict["usermac"]) {
alert("认证参数有问题,请稍后再试!")
return null;
}
phone = undefined ? sessionStorage.phone : phone;
paraDict['phone'] = phone;
$.ajax({
url: "auth/getsms.do", //请求后台的URL(*)
contentType: "application/json;charset=utf-8",
type: "POST",
// crossDomain: true,
// timeout: 3000,
data: JSON.stringify(paraDict),
dataType: "json",
success: function (res) {
$("#errMessage").html(res['message']);
$("#errMessage").show();
if ('200' == res['code']) {
if (data['messagestat'] == '3') {
$("#errMessage").html(res['message'] + ",验证码:" + res['codeSMS']);
$("#errMessage").show();
}
gettime();
}
},
error: function () {
$("#errMessage").html("网络异常,请稍后重试!");
$("#errMessage").show();
}
});
$('[name="getSMS"]').prop('disabled', true);
$('[name="getSMS"]').blur();
sessionStorage.phone = $('[name="phone"]').val();
}
function gettime() {
var resend = setInterval(function () {
if (second > 0) {
second--;
$('[name="getSMS"]').html(second + "秒");
sessionStorage.time = second;
} else {
clearInterval(resend);
$('[name="getSMS"]').html("重新发送");
$('[name="getSMS"]').prop('disabled', false);
second = data.phone.sms_interval;
}
}, 1000);
}
$(function () {
$.ajax({
url: "auth/getconfigjson.do", //请求后台的URL(*)
contentType: "application/json;charset=utf-8",
type: "POST",
// crossDomain: true,
// timeout: 3000,
dataType: "json",
// async: false,
success: function (res) {
data = res;
second = data['phone']['sms_interval'];
console.log(second)
if (sessionStorage.time > 0) {
second = sessionStorage.time;
data['phone']['smstext'] = second + '秒';
gettime();
}
if (null != sessionStorage.phone) {
$('[name="phone"]').val(sessionStorage.phone.length > 8 ? sessionStorage.phone : data.phone.smstext);
phone = $('[name="phone"]').val();
}
const banners = res.carousel.img
if (banners) {
$('#banners')
.html(banners.map((val, i) => `<div class="carousel-item${i ? '' : ' active'}"><img src="attachment/${val.url}" class="d-block w-100" alt="banner"></div>`).join(''))
.find('img').on('error', e => {
e.target.src = './img/banner.png'
})
}
}
});
paraString = location.search.substr(1);
var paraList = paraString.length ? paraString.split("&") : [];
$.each(paraList, function (index, val) {
var item = paraList[index].split("=");
paraDict[item[0]] = item[1];
})
if (null == paraDict["userip"] || null == paraDict["usermac"] || null == paraDict['nasip']) {
$("#errMessage").html("认证参数有问题,请稍后再试!");
$("#errMessage").show();
} else {
paraDict['usermac'] = paraDict['usermac'].toUpperCase();
// paraDict['nasip'] = '10.10.100.34';
}
paraDict['groupid'] = 3;
$.ajax({
url: "auth/mactrigger.do", //请求后台的URL(*)
contentType: "application/json;charset=utf-8",
type: "POST",
// crossDomain: true,
// timeout: 3000,
data: JSON.stringify(paraDict),
dataType: "json",
success: function (res) {
// alert(res['code'])
if (res['code'] == 200) {
$("#main").html(macTrigger);
//sleep 3秒钟再跳转
setTimeout(function () {
window.location.replace(data.url);
}, 3000);
} else if (res['code'] == 209) {
$("#main").html('<p style="color: green;font-size: 26px;margin-top: 20px;text-align: center">' + res['message'] + '</p>');
}
}
});
})
function login(type) {
paraDict['type'] = type;
switch (type) {
case 1:
//短信认证
var userCode = $('[name="authCode"]').val();
console.log(userCode)
if (null == userCode || userCode == undefined) {
$("#errMessage").html("请输入短信密码!");
$("#errMessage").show();
return null;
} else {
paraDict['phone'] = $('[name="phone"]').val();
paraDict['authcode'] = userCode;
}
break;
case 2:
window.location = "dotindex_wx.html?ssid=" + "DHLF" + "&usermac=" + paraDict['usermac'].replace(/-/g, ":").toLowerCase() + "&extend=" + paraDict['nasip'] + "," + paraDict['usermac'] + "," + paraDict['userip'];
//微信认证
break;
}
if (null == paraDict["userip"] || null == paraDict["usermac"] || null == paraDict['nasip']) {
$("#errMessage").html("认证参数有问题,请稍后再试!");
$("#errMessage").show();
return null;
}
$.ajax({
url: "auth/login.do", //请求后台的URL(*)
contentType: "application/json;charset=utf-8",
type: "POST",
// crossDomain: true,
// timeout: 3000,
data: JSON.stringify(paraDict),
dataType: "json",
success: function (res) {
if (res['code'] == 200) {
if (type == 2) {
$("#wximg").hide();
$("#skipimg").show();
//document.all("nouse").src = "http://www.baiud.com";
window.location = "dycwx2.html?ssid=" + data.wx.general.ssid + "&usermac=" + paraDict['usermac'].replace(/-/g, ":").toLowerCase() + "&extend=" + paraDict['nasip'] + "," + paraDict['usermac'] + "," + paraDict['userip'];
} else {
$("#errMessage").html(res['message']);
$("#errMessage").show();
// window.location.replace(data.url);
$("#main").html(macTrigger);
setTimeout(function () {
window.location.replace(data.url);
}, 3000);
}
} else {
$("#errMessage").html(res['message']);
$("#errMessage").show();
}
}
});
}
</script>