qlg.frontend/js/setting_pwd.js
2019-09-06 10:45:33 +08:00

60 lines
1.3 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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 == '') {
mui.alert('原支付密码不能为空!');
return;
}
if(newPass == '') {
mui.alert('新支付密码不能为空!');
return;
}
if(newPass.length < 6) {
mui.alert('新支付密码不能小于6位');
return;
}
if(!(newPass == newPass2)) {
mui.alert('两次支付密码不一致!');
return;
}
$(this).attr("disabled", true);
mui.ajax(qlgUrl('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) {
mui.alert(data.msg);
mui.back();
} else {
mui.alert(data.msg);
}
that.removeAttr('disabled');
},
error: function(xhr, type, errorThrown) {
//异常处理;
// mui.alert(type)
// mui.alert(type);
}
});
})
})