-
Notifications
You must be signed in to change notification settings - Fork 0
/
loginaddnew.html
176 lines (159 loc) · 7.39 KB
/
loginaddnew.html
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
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no">
<title>零零汽后台登录页面</title>
<link rel="stylesheet" type="text/css" href="./css/loginhtml.css">
</head>
<body>
<div class="LoginContainer">
<div class="LoginHeaderContainer">
零零汽后台管理系统
</div>
<div class="inputbody">账号:
<input id="username" placeholder="登录名" maxlength="11" value="" />
</div>
<div class="inputbody">密码:
<input id="password" placeholder="密码" type="password" value="" />
</div>
<div class="savepass">
<div class="remember-passworld">
<input type="checkbox" class="checkbox" />
记住密码
</div>
<span class="forget-passworld" onclick="change('tofwd')">忘记密码</span>
</div>
<button onclick="login()">登录</button>
</div>
<div class="FindPwd">
<div class="LoginHeaderContainer">
零零汽后台管理系统
</div>
<div class="inputbody">
<input id="phonenum" placeholder="手机号" maxlength="11" autocomplete="off" value="" />
</div>
<div class="inputbody inputbodysecond">
<input type="text" id="sentnum" name="">
<button value="" class="send-showworld" onclick="sendnum(60)">验证码</button>
<button value="" class="send-shownum" disabled>60</button>
</div>
<div class="inputbody">
<input id="newpassword" placeholder="新密码" type="text" autocomplete="off" value="" />
</div>
<button onclick="submit()" class="surechange">确认修改</button>
<span class="login-right" onclick="change('back')">立即登录</span>
</div>
<script type="text/javascript">
var version = 370
</script>
<script src="js/jquery-1.11.3.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/bossutils.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="./js/loginhtml.js" charset="urf-8"></script>
<!-- <script type="text/javascript">
var local = ["vipname","vippassnum"];
var _username = localStorage.getItem(local[0]) || $('#username').attr("value");
var _password = localStorage.getItem(local[1]) || $('#password').attr("value") ;
$('#username').attr("value",_username)
$('#password').attr("value",_password)
if (localStorage.getItem(local[0])!=undefined) {
$(".checkbox").prop("checked",true)
}else{
$(".checkbox").prop("checked",false)
}
$('#username').bind('input propertychange', function() {
_username = $('#username').attr("value")
});
$('#password').bind('input propertychange', function() {
_password = $('#password').attr("value")
});
function login() {
// var _username = document.getElementById('username').value
// var _password = document.getElementById('password').value
if(_username.length < 1) {
alert('输入用户名')
return
}
if(_password.length < 1) {
alert('输入密码')
return
}
let _urls = "http://192.168.10.111:81/login"
_urls = "/login"
let _objs = {
username: _username,
password: _password
}
let _remembernum = $(".checkbox").prop("checked")
if (_remembernum) {
localStorage.setItem(local[0],_username)
localStorage.setItem(local[1],_password)
}
postAjax(_urls, _objs, function(res) {
location.href = "/"
})
}
//忘记密码 或者 立即登录
function change (type){
if (type=="tofwd") {
$(".LoginContainer").css('display', 'none');
$(".FindPwd").css('display', 'flex');
}else{
$(".LoginContainer").css('display', 'flex');
$(".FindPwd").css('display', 'none');
}
}
function sendnum(t){
let phonenum = $('#phonenum').attr("value")
if (phonenum.length != 11) {
alert("请输入正确手机号")
}else{
$(".send-showworld").css('display', 'none');
$(".send-shownum").css('display', 'inline-block');
for(i=1;i<=t;i++) {
window.setTimeout("update_p(" + i + "," + t + ")", i * 1000);
}
let _url = "/changepwd_sms"
let _obj = {
phone: phonenum
}
postAjax(_url, _obj, function(res) {
alert("验证码已发送到您手机!")
})
}
}
function update_p(num,t) {
if(num == t) {
$(".send-showworld").css('display', 'inline-block');
$(".send-shownum").css('display', 'none');
}else {
let printnr = t - num;
let printnrnum = printnr + "s"
$(".send-shownum").text(printnrnum)
}
}
function submit(){
let phonenum = $('#phonenum').attr("value")
let sentnum = $("#sentnum").attr("value")
let newpassword = $('#newpassword').attr("value")
if (phonenum.length!=11 ) {
alert("请输入正确手机号")
}else if(sentnum.length <1){
alert("请输入验证码")
}else if(newpassword.length<1){
alert("请输入新密码")
}else{
let _url = "/changepwd"
let _obj = {
phone: phonenum,
sms_code: sentnum,
password: newpassword
}
postAjax(_url, _obj, function(res) {
location.href = "/"
})
}
}
</script> -->
</body>
</html>