//---------------------------------------------------------- // http://passport.isstech.com/forgot/JS/Index // 脚本生成时间: 2024/4/28 6:44:49 // Copyright © 2001-2024 软通动力信息技术(集团)有限公司 版权所有 //---------------------------------------------------------- /// var index = { pageload: function () { $("#RP_EmpDomainName").val("请您输入域用户名"); $.validator.unobtrusive.parse("#formName"); index.usecondhandle(); index.textboxinit(); index.getimg(); $(".piclist a").click(function () { var type = $(this).attr("ajax-type"); if ($(this).attr("disabled")) { return false; } var s = $(this).attr("ajax-data"); var t = s + "sel"; if ($(this).hasClass(t)) { return false; } var length = $(".piclist a:not(." + s + ")").length; $f = $(".piclist a:not(." + s + ")"); for (var i = 0; i < length; i++) { var m = $f.eq(i).attr("ajax-data"); var n = m + "sel"; $f.eq(i).removeClass(n).addClass(m); } $(this).removeClass(s).addClass(t); if (type == "1") { $("#loading").show(); $.ajax({ type: "POST", url: '/Forgot/UserName/', success: function (result) { $("#loading").hide(); $(".maincontent").html(result); $("#RP_EmpDomainName").val("请您输入域用户名"); $.validator.unobtrusive.parse("#formName"); index.usecondhandle(); index.textboxinit(); $("#cimg").attr("src", '/Forgot/GetCodeImg?time=' + new Date().getTime()); index.getimg(); } }); } if (type == "3") { $("#loading").show(); $.ajax({ type: "POST", url: '/Forgot/BindingMobile/', success: function (result) { $("#loading").hide(); $(".maincontent").html(result); $("#RP_EmpDomainName").val("请您输入域用户名"); $("#RP_EmpMobile").val("请输入绑定手机号"); $.validator.unobtrusive.parse("#formMobile"); index.msecondhandle(); index.textboxinit(); $("#cimg").attr("src", '/Forgot/GetCodeImg?time=' + new Date().getTime()); index.getimg(); } }); } }); }, usecondhandle: function () { $("#unext").click(function () { var s = $("#RP_EmpDomainName").val().replace("请您输入域用户名", ""); $("#RP_EmpDomainName").val(s); var t = $("#imgcode").val().replace("请输入验证码", ""); $("#imgcode").val(t); if ($("#formName").valid()) { $("#loading").show(); $.ajax({ type: "POST", url: '/Forgot/CheckCurrentCode?' + Math.random(), data: { code: $("#imgcode").val() }, success: function (result) { if (result == "0") { $("#loading").hide(); iPSA.Msg.Show("验证码输入有误"); $("#cimg").attr("src", '/Forgot/GetCodeImg?time=' + new Date().getTime()); return false; } else { $("#loading").show(); $.ajax({ type: "POST", url: '/Forgot/CheckName/', data: { name: $("#RP_EmpDomainName").val() }, success: function (result) { if (result == "nouser") { iPSA.Msg.Show("输入的用户不存在!"); $("#loading").hide(); } else if (result == "noquestion") { iPSA.Msg.Show("该用户未设置密码保护问题!"); $("#loading").hide(); } else { $("#loading").show(); $.ajax({ type: "POST", url: '/Forgot/SecurityQuestion/', data: { myid: result }, success: function (result) { $("#loading").hide(); $(".maincontent").html(result); $(".msg p").html("您正在找回的域账号是:" + $("#RP_EmpDomainName").val()); $("#step div").eq(0).removeClass("step1").addClass("step11"); $("#step div").eq(0).children("span").removeClass("current"); $("#step div").eq(1).removeClass("step2").addClass("step22"); $("#step div").eq(1).children("span").addClass("current"); $("#step div").eq(2).removeClass("step3").addClass("step33"); $(".piclist a").attr("disabled", "disabled").css("cursor", "default"); $(".htitle").css("display", "none"); $(".gtype").css("display", "none"); $.validator.unobtrusive.parse("#formQuestion"); index.uthirdhandle(); index.textboxinit(); } }); } } }); } } }); } }); }, msecondhandle: function () { $("#mbtn").click(function () { var s = $("#RP_EmpDomainName").val().replace("请您输入域用户名", ""); var t = $("#RP_EmpMobile").val().replace("请输入绑定手机号", ""); $("#RP_EmpDomainName").val(s); $("#RP_EmpMobile").val(t); var m = $("#imgcode").val().replace("请输入验证码", ""); $("#imgcode").val(m); if ($("#formMobile").valid()) { $("#loading").show(); $.ajax({ type: "POST", url: '/Forgot/CheckCurrentCode?' + Math.random(), data: { code: $("#imgcode").val() }, success: function (result) { if (result == "0") { iPSA.Msg.Show("验证码输入有误"); $("#loading").hide(); $("#cimg").attr("src", '/Forgot/GetCodeImg?time=' + new Date().getTime()); return false; } else { var name = $("#RP_EmpDomainName").val(); $("#loading").show(); $.ajax({ type: "POST", url: '/Forgot/CheckMobile/', data: { name: $("#RP_EmpDomainName").val(), phone: $("#RP_EmpMobile").val() }, success: function (result) { if (result == "0") { iPSA.Msg.Show("域名与手机号不匹配!"); $("#loading").hide(); return false; } else if (result == "error") { iPSA.Msg.Show("发送短信失败,请联系管理员!"); $("#loading").hide(); return false; } else if (result == "failed") { iPSA.Msg.Show("该手机号当日发送短信次数超过上限,请改日再发!"); $("#loading").hide(); return false; } else { $("#loading").show(); $.ajax({ type: "POST", url: '/Forgot/Securitycode/', data: { mid: result }, success: function (result) { $("#loading").hide(); $(".maincontent").html(result); $(".msg p").html("您正在找回的域账号是:" + name); $("#step div").eq(0).removeClass("step1").addClass("step11"); $("#step div").eq(0).children("span").removeClass("current"); $("#step div").eq(1).removeClass("step2").addClass("step22"); $("#step div").eq(1).children("span").addClass("current"); $("#step div").eq(2).removeClass("step3").addClass("step33"); $(".piclist a").attr("disabled", "disabled").css("cursor", "default"); $(".htitle").css("display", "none"); $(".gtype").css("display", "none"); index.mthirdhandle(); index.textboxinit(); } }); } } }); } } }); } }); }, uthirdhandle: function () { $("#unxtbtn").click(function () { var name = $("#RP_EmpDomainName").val(); var id = $("#RP_ID").val(); if ($("#formQuestion").valid()) { $("#loading").show(); $("#formQuestion").ajaxSubmit({ success: function (result) { if (result == "") { iPSA.Msg.Show("获取密码保护信息异常"); $("#loading").hide(); return false; } if (result != "success") { iPSA.Msg.Show(result + "答案有误"); $("#loading").hide(); return false; } else { $("#loading").show(); $.ajax({ type: "POST", url: '/Forgot/RetrievePassword/', data: { mid: id }, success: function (result) { $("#loading").hide(); $(".maincontent").html(result); $(".msg p").html("您正在找回的域账号是:" + name); $("#step div").eq(0).removeClass("step11").addClass("step111"); $("#step div").eq(1).removeClass("step22").addClass("step222"); $("#step div").eq(1).children("span").removeClass("current"); $("#step div").eq(2).removeClass("step33").addClass("step333"); $("#step div").eq(2).children("span").addClass("current"); $(".piclist a").attr("disabled", "disabled").css("cursor", "default"); index.forgot(); index.textboxinit(); } }); } } }); } }); $("#prestep").click(function () { iPSA.GoToUrl('/Forgot/Index/'); }); }, mthirdhandle: function () { $("#mnxtbtn").click(function () { var dname = $("#Dname").val(); var s = $("#codeinput").val().replace("请输入手机验证码", ""); $("#codeinput").val(s); if ($("#codeinput").val() == "") { iPSA.Msg.Show("请输入手机验证码"); return false; } $("#loading").show(); $.ajax({ type: "POST", url: '/Forgot/CheckCode/', data: { mid: $("#mid").val(), code: $("#codeinput").val() }, success: function (result) { if (result == "0") { iPSA.Msg.Show("手机验证码有误"); $("#loading").hide(); return false; } if (result == "1") { iPSA.Msg.Show("手机验证码已过期"); $("#loading").hide(); iPSA.GoToUrl('/Forgot/Index/'); return false; } if (result == "3") { iPSA.Msg.Show("手机验证码错误次数过多"); iPSA.GoToUrl('/Forgot/Index/'); $("#loading").hide(); return false; } if (result == "2") { $("#loading").show(); $.ajax({ type: "POST", url: '/Forgot/RetrievePassword/', data: { mid: $("#mid").val() }, success: function (result) { $("#loading").hide(); $(".maincontent").html(result); $(".msg p").html("您正在找回的域账号是:" + dname); $("#step div").eq(0).removeClass("step11").addClass("step111"); $("#step div").eq(1).removeClass("step22").addClass("step222"); $("#step div").eq(1).children("span").removeClass("current"); $("#step div").eq(2).removeClass("step33").addClass("step333"); $("#step div").eq(2).children("span").addClass("current"); $(".piclist a").attr("disabled", "disabled").css("cursor", "default"); index.forgot(); index.textboxinit(); } }); } } }); }); $("#prestep").click(function () { iPSA.GoToUrl('/Forgot/Index/'); }); }, forgot: function () { $("input[name='inppass']").click(function () { var s = $("#text1").val().replace("请输入新密码", ""); $("#text1").val(s); var t = $("#text2").val().replace("请重新输入新密码", ""); $("#text2").val(t); if ($("#text1").val() != $("#text2").val()) { iPSA.Msg.Show("两次输入密码不一致,请重新输入!"); return false; } if ($("#text1").val() == "" || $("#text2").val() == "") { iPSA.Msg.Show("请输入密码!") return false; } else { $("#loading").show(); $.ajax({ type: "POST", url: '/Forgot/ChangePassport/', data: { mid: $("#mid").val(), passport: $("#text1").val() }, success: function (result) { if (result != "1") { $.ajax({ type: "POST", data: { mid: $("#mid").val(), error: result }, url: '/Forgot/Saveerror/', success: function (result) { $("#loading").hide(); iPSA.Msg.Show("密码不符合规则"); } }); } else { iPSA.Msg.Show("重置成功!"); iPSA.GoToUrl('/Forgot/Index/'); $("#loading").hide(); } } }); } }); }, textboxinit: function () { var mycolor = $(".inp input").css("color"); $(".inp input").focus(function () { if ($(this).css("color") == mycolor) { $(this).val(""); $(this).css("color", "black"); } }); $(".inp input").blur(function () { var name = $(this).attr("name"); if ($(this).val() == "") { switch (name) { case 'RP_EmpDomainName': $(this).val("请您输入域用户名").css("color", "#c7c5c5"); break; case 'RP_EmpMobile': $(this).val("请输入绑定手机号").css("color", "#c7c5c5"); break; case 'pass': $(this).css("color", "#c7c5c5"); break; case 'npass': $(this).css("color", "#c7c5c5"); break; case 'code': $(this).val("请输入验证码").css("color", "#c7c5c5"); break; case 'phocode': $(this).val("请输入手机验证码").css("color", "#c7c5c5"); break; default: break; } } }); }, getimg: function () { $("#cimg").click(function () { $("#cimg").attr("src", '/Forgot/GetCodeImg?time=' + new Date().getTime()); }); } };