|
楼主 |
发表于 2016-8-25 21:03:19
|
显示全部楼层
// 校验手势密码输入是否正确
Model.prototype.lockerInput = function(event) {
// justep.Util.hint("手势:" + event.values);
var inPhoneNo = this.comp("phoneNo").val();
if (!isPhoneNumber(inPhoneNo)) {
justep.Util.hint("请输入有效的手机号码!", {
"type" : "danger",
"delay" : 2000
});
return;
} else {
// 查询该手机号对应的手势密码
justep.Baas.sendRequest({
"url" : "/study/shcontact",
"action" : "queryUser",
"async" : false,
"params" : {
condition : "fPhoneNO = '" + inPhoneNo + "' and fGesture='" + md5.hex_md5_salt(event.values + "") + "'"
},
"success" : function(data) {
if (data.rows.length > 0) {
// if (md5.hex_md5_salt(event.values) ==
// data.rows[0].fGesture.value) {
event.clear = true;
justep.Util.hint("密码验证通过。", {
"delay" : 1000
});
// 登录成功,进入程序主页面
var url = require.toUrl("./org.w");
dialog.open({
src : url,
params : {}
});
} else {
event.clear = true;
justep.Util.hint("用户手势密码未设置,或密码输入错误!", {
"type" : "danger",
"delay" : 2000
});
return;
}
}
});
}
}; |
|