Repository navigation
Expand file tree
/
Copy pathaccount.php
More file actions
273 lines (242 loc) · 11.6 KB
/
Copy pathaccount.php
File metadata and controls
273 lines (242 loc) · 11.6 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>账户安全</title>
<!-- Latest compiled and minified CSS -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="stylesheet" href="../../../public/css/login.css">
<script type="text/javascript" src="../../../public/js/jquery.min.js"></script>
<script src="../../../public/js/jquery.i18n.properties.min.js"></script>
<script src="../../../public/js/template-web.js"></script>
<script src="../../../public/js/zalyjsNative.js"></script>
</head>
<body>
<div class="zaly_container" >
<div class="zaly_login zaly_site_register zaly_site_register-repwd" >
<div class="login_input_div" >
<div class="d-flex flex-row justify-content-center login-header " style="text-align: center;margin-top: 8rem;">
<span class="login_phone_tip_font" data-local-value="resetPwdTip">重置密码</span>
</div>
<div class="login_name_div login_name_div_mobile">
<image src="../../public/img/login/loginName.png" class="img"/>
<input type="text" class="input_login_site forget_input_loginName" datatype="s" autocapitalize="off" data-local-placeholder="loginNamePlaceholder" placeholder="输入登录名">
<img src="../../../public/img/msg/msg_failed.png" class="img-failed forget_input_loginName_failed">
<div class="line"></div>
</div>
<div class="login_name_div forget_input_pwd_div margin-top2" >
<image src="../../public/img/login/pwd.png" class="img"/>
<input type="password" class="input_login_site forget_input_oldPwd" autocapitalize="off" data-local-placeholder="enterOldPasswordPlaceholder" placeholder="输入旧密码" >
<div class="pwd_div" onclick="changeImgByClickOldPwd()"><image src="../../public/img/login/hide_pwd.png" class="oldPwd" img_type="hide"/></div>
<img src="../../../public/img/msg/msg_failed.png" class="img-failed forget_input_oldPwd_failed">
<div class="line"></div>
</div>
<div class="login_name_div forget_input_pwd_div margin-top2" >
<image src="../../public/img/login/pwd.png" class="img"/>
<input type="password" class="input_login_site forget_input_pwd" autocapitalize="off" data-local-placeholder="enterPasswordPlaceholder" placeholder="输入密码,长度5到20个字符" >
<div class="pwd_div" onclick="changeImgByClickPwd()"><image src="../../public/img/login/hide_pwd.png" class="pwd" img_type="hide"/></div>
<img src="../../../public/img/msg/msg_failed.png" class="img-failed forget_input_pwd_failed">
<div class="line"></div>
</div>
<div class="login_name_div forget_input_repwd_div margin-top2" >
<image src="../../public/img/login/re_pwd.png" class="img"/>
<input type="password" class="input_login_site forget_input_repwd" autocapitalize="off" data-local-placeholder="enterRepasswordPlaceholder" placeholder="再次输入密码" >
<div class="repwd_div" onclick="changeImgByClickRepwd()"><image src="../../public/img/login/hide_pwd.png" class="repwd" img_type="hide"/></div>
<img src="../../../public/img/msg/msg_failed.png" class="img-failed forget_input_repwd_failed">
<div class="line" ></div>
</div>
<div class="d-flex flex-row justify-content-center ">
<button type="button" class="btn reset_pwd_button"><span class="span_btn_tip" data-local-value="updatePwdTip">修改密码</span></button>
</div>
</div>
</div>
</div>
<script src="../../public/js/im/zalyKey.js"></script>
<script src="../../public/js/im/zalyAction.js"></script>
<script src="../../public/js/im/zalyClient.js"></script>
<script src="../../public/js/im/zalyBaseWs.js"></script>
<script type="text/javascript">
var languageName = getLanguageName();
var languageNum = getLanguage();
jQuery.i18n.properties({
name: "lang",
path: '../../public/js/config/',
mode: 'map',
language: languageName,
callback: function () {
try {
//初始化页面元素
$('[data-local]').each(function () {
var changeData = $(this).attr("data-local");
var changeDatas = changeData.split(":");
var changeDataName = changeDatas[0];
var changeDataValue = changeDatas[1];
$(this).attr(changeDataName, $.i18n.map[changeDataValue]);
});
$('[data-local-value]').each(function () {
var changeHtmlValue = $(this).attr("data-local-value");
$(this).html($.i18n.map[changeHtmlValue]);
});
$('[data-local-placeholder]').each(function () {
var placeholderValue = $(this).attr("data-local-placeholder");
$(this).attr("placeholder", $.i18n.map[placeholderValue]);
});
}
catch(ex){
console.log(ex.message);
}
}
});
$(":input").attr("autocapitalize", "off");
function changeImgByClickPwd() {
var imgType = $(".pwd").attr("img_type");
if(imgType == "hide") {
$(".pwd").attr("img_type", "display");
$(".pwd").attr("src", "../../public/img/login/display_pwd.png");
$(".login_input_pwd").attr("type", "text");
$(".register_input_pwd").attr("type", "text");
$(".forget_input_pwd").attr("type", "text");
} else {
$(".pwd").attr("img_type", "hide");
$(".pwd").attr("src", "../../public/img/login/hide_pwd.png");
$(".login_input_pwd").attr("type", "password");
$(".register_input_pwd").attr("type", "password");
$(".forget_input_pwd").attr("type", "password");
}
}
function changeImgByClickOldPwd()
{
var imgType = $(".oldPwd").attr("img_type");
if(imgType == "hide") {
$(".oldPwd").attr("img_type", "display");
$(".oldPwd").attr("src", "../../public/img/login/display_pwd.png");
$(".forget_input_oldPwd").attr("type", "text");
} else {
$(".oldPwd").attr("img_type", "hide");
$(".oldPwd").attr("src", "../../public/img/login/hide_pwd.png");
$(".forget_input_oldPwd").attr("type", "password");
}
}
function changeImgByClickRepwd() {
var imgType = $(".repwd").attr("img_type");
if(imgType == "hide") {
$(".repwd").attr("img_type", "display");
$(".repwd").attr("src", "../../public/img/login/display_pwd.png");
$(".register_input_repwd").attr("type", "text");
$(".forget_input_repwd").attr("type", "text");
} else {
$(".repwd").attr("img_type", "hide");
$(".repwd").attr("src", "../../public/img/login/hide_pwd.png");
$(".register_input_repwd").attr("type", "password");
$(".forget_input_repwd").attr("type", "password");
}
}
function handleHtmlLanguage(html)
{
$(html).find("[data-local-placeholder]").each(function () {
var placeholderValue = $(this).attr("data-local-placeholder");
var placeholder = $(this).attr("placeholder");
var newPlaceholder = $.i18n.map[placeholderValue];
html = html.replace(placeholder, newPlaceholder);
});
$(html).find("[data-local-value]").each(function () {
var changeHtmlValue = $(this).attr("data-local-value");
var valueHtml = $(this).html();
var newValueHtml = $.i18n.map[changeHtmlValue];
// $(this).html(newValueHtml);
html = html.replace(valueHtml, newValueHtml);
});
return html;
}
/**
* 数字 字母下划线
* @param password
*/
function isPassword(password) {
var reg = /^[^\u4e00-\u9fa5]+$/;
return reg.test(password);
}
$(document).on("click", ".reset_pwd_button", function () {
var isFoucs = false;
var action = "api.passport.passwordResetPassword";
var isFocus = false;
var oldPassword = $(".forget_input_oldPwd").val();
var repassword = $(".forget_input_repwd").val();
var newPassword = $(".forget_input_pwd").val();
loginName = $(".forget_input_loginName").val();
if(loginName == "" || loginName == undefined || loginName.length<0) {
$(".forget_input_loginName").focus();
$(".forget_input_loginName_failed")[0].style.display = "block";
isFocus = true;
}
if(oldPassword == "" || oldPassword.length<1 ) {
$(".forget_input_oldPwd_failed")[0].style.display = "block";
if(isFocus == false) {
$(".forget_input_oldPwd").focus();
$(".forget_input_loginName_failed")[0].style.display = "none";
isFocus = true;
}
}
if(newPassword == "" || newPassword.length<5 || newPassword.length>20 || !isPassword(newPassword)) {
$(".forget_input_pwd_failed")[0].style.display = "block";
if(isFocus == false) {
$(".forget_input_pwd").focus();
$(".forget_input_loginName_failed")[0].style.display = "none";
$(".forget_input_oldPwd_failed")[0].style.display = "none";
isFocus = true;
}
}
if(repassword == "" || repassword.length<1) {
$(".forget_input_repwd_failed")[0].style.display = "block";
if(isFocus == false) {
$(".forget_input_repwd").focus();
$(".forget_input_pwd_failed")[0].style.display = "none";
$(".forget_input_loginName_failed")[0].style.display = "none";
$(".forget_input_oldPwd_failed")[0].style.display = "none";
isFocus = true;
}
}
if(isFocus == true) {
return;
}
$(".forget_input_loginName_failed")[0].style.display = "none";
$(".forget_input_oldPwd_failed")[0].style.display = "none";
$(".forget_input_pwd_failed")[0].style.display = "none";
$(".forget_input_repwd_failed")[0].style.display = "none";
if(repassword != newPassword) {
zalyjsAlert($.i18n.map['passwordIsNotSameJsTip']);
return;
}
var reqData = {
"loginName" : loginName,
"newPassword" :newPassword,
"password" :oldPassword
};
var action = "api.passport.passwordModifyPassword"
handleClientSendRequest(action, reqData, handleModifyPassword);
});
function handleModifyPassword() {
$.ajax({
method: "POST",
url:"./index.php?action=miniProgram.passport.account&lang="+languageNum,
data: {"loginName" : loginName},
success:function (resp, status, request) {
var error = JSON.parse(resp);
if(error["errCode"].length>1 && error["errCode"] != "success") {
zalyjsAlert(error['errCode']);
return;
}
try{
zalyjsNavClosePlugin();
}catch (error) {
}
},
failed:function (error) {
console.log(error);
}
});
}
</script>
</body>
</html>