-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchangepwd.html
135 lines (132 loc) · 4.07 KB
/
changepwd.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>修改密码</title>
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="stylesheet" type="text/css" href="css/mui.min.css" />
<style type="text/css">
.mui-table h4,
.mui-table h5,
.mui-table .mui-h5,
.mui-table .mui-h6,
.mui-table p {
margin-top: 0;
}
.mui-table h4 {
line-height: 21px;
font-weight: 500;
}
.mui-table .oa-icon {
position: absolute;
right: 0;
bottom: 0;
}
.mui-table .oa-icon-star-filled {
color: #f14e41;
}
textarea.noscrollbars {
overflow: hidden;
width: 100%;
height: 80px;
}
</style>
</head>
<body>
<!--<header class="mui-bar mui-bar-nav">
<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
<a class="mui-icon mui-icon-home-filled mui-pull-right" style="color: #999;" href="main.html"></a>
<h1 class="mui-title">修改密码</h1>
</header>-->
<div id="content" class="mui-content">
<p style="margin-left:15px; margin-top: 10px; font-size: medium;">修改密码</p>
<form id='login-form' class="mui-input-group">
<div class="mui-input-row">
<label>旧密码</label>
<input id='oldpassword' type="password" class="mui-input-clear mui-input" placeholder="请输入原密码">
</div>
<div class="mui-input-row">
<label>新密码</label>
<input id='password' type="password" class="mui-input-clear mui-input" placeholder="请输入新密码">
</div>
<div class="mui-input-row">
<label>确认密码</label>
<input id='password_confirm' type="password" class="mui-input-clear mui-input" placeholder="请再次输入新密码">
</div>
<div class="mui-content-padded">
<button id='qr' class="mui-btn mui-btn-block mui-btn-primary">确认修改</button>
<a href="main.html" class="mui-btn mui-btn-block">返回</a>
</div>
</form>
</div>
<script src="js/mui.min.js"></script>
<!--<script src="js/jquery.min.js"></script>-->
<script src="js/baseData.js"></script>
<script>
(function($, doc) {
$.init({
statusBarBackground: '#f7f7f7'
});
$.plusReady(function() {
var qr = document.getElementById('qr');
qr.addEventListener('tap', function(event) {
var oldpwd=document.getElementById('oldpassword').value.trim();
var newpwd=document.getElementById('password').value.trim();
var pwdcnf=document.getElementById('password_confirm').value.trim();
if(oldpwd==""){
plus.nativeUI.toast("请输入原密码");
return;
}
if(newpwd==""){
plus.nativeUI.toast("请输入新密码");
return;
}
if(pwdcnf==""){
plus.nativeUI.toast("请输入确认密码");
return;
}
if(newpwd!=pwdcnf){
plus.nativeUI.toast("两次密码输入不一致");
return;
}
var url=baseUrl + "/Account/changPwdApp";
var uid=localStorage.getItem("localUserId");
$.ajax({
type:"get",
url:url,
dataType:"json",
async:false,
data:{ uid: uid, oldPass: oldpwd, newPass: newpwd},
success:function(data){
if(data != null) {
var datas = eval(data);
if(datas.status==4){
plus.nativeUI.toast("原密码错误,请重试");
}else if(datas.status==5){
localStorage.pwd=newpwd;
plus.nativeUI.toast("修改成功");
}else{
plus.nativeUI.toast("修改异常,请稍后重试");
}
}
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
plus.nativeUI.toast("修改失败,请稍后重试");
// mui.openWindow({
// url: "main.html",
// id: "main"
// });
}
});
//changPwdApp
//后台方法 检查旧密码是否正确
//success login.html
//设置自动登录 本地存储账号密码
})
});
}(mui, document));
</script>
</body>
</html>