You've already forked qlg.tsgz.moe
Init Repo
This commit is contained in:
60
static/app/js/setting_pwd.js
Executable file
60
static/app/js/setting_pwd.js
Executable file
@ -0,0 +1,60 @@
|
||||
mui.plusReady(function() {
|
||||
var token = localStorage.getItem('token');
|
||||
|
||||
mui('.down').on('tap', '#true', function() {
|
||||
var that = $(this)
|
||||
var oldPass = $('#oldPass').val();
|
||||
var newPass = $('#newPass').val();
|
||||
var newPass2 = $('#newPass2').val();
|
||||
|
||||
if(oldPass == '') {
|
||||
alert('原支付密码不能为空!');
|
||||
return;
|
||||
}
|
||||
if(newPass == '') {
|
||||
alert('新支付密码不能为空!');
|
||||
return;
|
||||
}
|
||||
if(newPass.length < 6) {
|
||||
alert('新支付密码不能小于6位!');
|
||||
return;
|
||||
}
|
||||
if(!(newPass == newPass2)) {
|
||||
alert('两次支付密码不一致!');
|
||||
return;
|
||||
}
|
||||
|
||||
$(this).attr("disabled", true);
|
||||
mui.ajax(hyhUrl('app/users/editloginPwd'), {
|
||||
|
||||
data: {
|
||||
oldPass: oldPass,
|
||||
newPass: newPass
|
||||
},
|
||||
dataType: 'json', //服务器返回json格式数据
|
||||
type: 'post', //HTTP请求类型
|
||||
timeout: 10000, //超时时间设置为10秒
|
||||
success: function(data) {
|
||||
var data = toJson(data);
|
||||
//服务器返回响应,根据响应结果,分析是否登录成功;
|
||||
console.log(data.status)
|
||||
if(data.status == 1) {
|
||||
|
||||
alert(data.msg);
|
||||
mui.back();
|
||||
|
||||
} else {
|
||||
alert(data.msg);
|
||||
}
|
||||
that.removeAttr('disabled');
|
||||
},
|
||||
|
||||
error: function(xhr, type, errorThrown) {
|
||||
//异常处理;
|
||||
// alert(type)
|
||||
// alert(type);
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
})
|
Reference in New Issue
Block a user