<!DOCTYPE HTML> <html> <meta charset="utf-8" /> <title>个人中心 - 信用中国(开封)</title> <meta http-equiv="keywords" content="开封信用网"/> <meta http-equiv="description" content="开封信用网"/> <link rel="icon" href="/r/cms/www/default/img/favicon.ico" type="image/x-icon"/> <script type="text/javascript" src="/r/cms/www/default/js/jquery-1.11.0.js"></script> <link type="text/css" rel="stylesheet" href="/r/cms/www/default/css/style.css" /> <link type="text/css" rel="stylesheet" href="/r/cms/www/default/css/index.css" /> <link type="text/css" rel="stylesheet" href="/r/cms/www/default/css/zhuce.css" /> <!--[if lt IE 9]> <script src="/r/cms/www/default/js/html5shiv.min.js"></script> <script src="/r/cms/www/default/js/respond.min.js"></script> <![endif]--> <head> <body> <div id="shouye_wrap">
<div class="yiyi_main clear"> <div class="yiyi_luyou"> <a style="padding-left: 45px;" href='/'>首页</a> > <a href='/grzx.jhtml' target='_blank'>个人中心</a> </div><!--路由结束--> <div class="denglu_div"> <div class="sgsqieh"> <ul> <li class="onsgstie" id="jbxx">用户信息修改</li> <li id="xgmm">密码修改</li> </ul> </div> <div class="zcone"> <div class="zctietop"> </div> <form class="tianxsf"> <input type="hidden" value="" id="id"> <div class="zctext" ><label><i class="red">*</i>姓名:</label><input type="text" id="username" value="" ><p class="zctis" id="usernameType"></p></div> <div class="zctext" ><label><i class="red">*</i>身份证号码:</label><input type="text" id="identitycode" value="" ><p class="zctis" id="identitycodeType"></p></div> <div class="zctext" ><label><i class="red">*</i>手机号码:</label><input type="text" id="mobile" value=""><p class="zctis" id="mobileType" ></p></div> <div class="zctext"><label><i class="red">*</i>电子邮箱:</label><input type="text" id="mail" value=""><p class="zctis" id="mailType"></p></div> </form> <div class="xieyi"> </div> <div class="zcbtn"> <input type="button" onclick="tijiaoxinxi()" value="保存" class="nextone" /> </div> </div> <div class="zctwo" style="display: none;"> <div class="zctietop"> </div> <form class="tianxsf"> <input type="hidden" value="" id="initialPassword"> <div class="zctext"><label><i class="red">*</i>原密码:</label><input type="password" id="oldPassword" style="width: 240px;"><p class="zctis" id="oldPasswordTip"></p></div> <div class="zctext"><label><i class="red">*</i>新密码:</label><input type="password" id="newPassword" style="width: 240px;" onKeyUp=pwdStrength(this.value) onBlur=pwdStrength(this.value)><p class="zctis" id="newPasswordType"></p></div> <div class="zctext" style="font-size: 12px;margin: 0px"> <span >密码强度:</span> <span id="strength_L" style="background-color: #eeeeee;">  弱  </span> <span id="strength_H" style="background-color: #eeeeee;">  强  </span> </div> <div class="zctext"><label><i class="red">*</i>密码确认:</label><input type="password" id="newPassword2" style="width: 240px;"><p class="zctis" id="newPasswordType2"></p></div> <div class="zctext"> <span style="color: red;font-size: 12px;">注:密码必须包含大写字母、小写字母、数字、特殊字符并且大于等于8位。</span> </div> </form> <div class="zcbtn"> <input type="button" value="保存" onclick="tijiaomima()" class="nexttwo" style="width: 100px" /> </div> </div> <div class="zcthire" style="display: none;"> <div class="zctietop"> </div> <div class="zcwac"> <p>修改成功!</p> </div> </div> </div>
友情链接
</div> </div> <script src="/r/cms/www/default/js/jquery-1.11.0.js" type="text/javascript" charset="utf-8"></script> <script src="/r/cms/www/default/js/pwdStrength.js" type="text/javascript" charset="utf-8"></script> <script src="/r/cms/www/default/js/idCardValidatation.js" type="text/javascript" charset="utf-8"></script> <script type="text/javascript"> //验证修改后的身份证 function checkUpdataEnergyCard(id){ var type=true; var allowancePersonValue=$(id).val(); //是否为空 if(allowancePersonValue==""){ $("#identitycodeType").html("身份证号码不能空!"); $("#identitycodeType").css("color","red"); type=false; } //校验长度,类型 else if(isCardNo(allowancePersonValue) == false) { checkEnergyCardMessage(); type=false; } //检查省份 else if(checkProvince(allowancePersonValue) == false) { checkEnergyCardMessage(); type=false; } //校验生日 else if(checkBirthday(allowancePersonValue) == false) { checkEnergyCardMessage(); type=false; } //检验位的检测 else if(checkParity(allowancePersonValue) == false) { checkEnergyCardMessage(); type=false; }else{ type=true; $("#identitycodeType").html(""); return type; } } //验证用户名 function checkUserName(val){ if(val.indexOf("admin")>=0||val.indexOf("test")>=0) { $("#usernameType").html("登录名为特殊名称,请更换!"); $("#usernameType").css("color", "red"); return false; } var pattern = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?]") if(val.length<1 || val.length>30){ $("#usernameType").html("用户名长度为1-30个字符"); $("#usernameType").css("color","red"); return false; } if(pattern.test(val)){ $("#usernameType").html("不能包含特殊字符"); $("#usernameType").css("color","red"); return false; } $("#usernameType").html(""); return true; } //手机号验证 function checkMobile(val){ var type=true; var reg = /(^0{0,1}1[3|4|5|6|7|8|9][0-9]{9}$)/; if(!reg.test(val)){ $("#mobileType").html("请输入正确的手机号"); $("#mobileType").css("color","red"); return false ; } $("#mobileType").html(""); return true; } //邮箱验证 function checkMail(val){ var type=true; var reg = /^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/; if(!reg.test(val)){ $("#mailType").html("邮箱格式不正确"); $("#mailType").css("color","red"); return false } $("#mailType").html(""); return true; } //密码验证 function checkPassWord(val){ var password=$("#initialPassword").val(); var newPassword=$("#newPassword").val(); var newPassword2=$("#newPassword2").val(); if(val.length<1){ $("#oldPasswordTip").html("密码不能为空"); $("#oldPasswordTip").css("color","red"); return false; } if(password != val){ $("#oldPasswordTip").html("与原密码不一致"); $("#oldPasswordTip").css("color","red"); return false; } $("#oldPasswordTip").html(""); return true; } //新密码验证 function checkPassWord2(val){ if(val.length<1){ $("#newPasswordType").html("密码不能为空"); $("#newPasswordType").css("color","red"); return false; } $("#newPasswordType").html(""); return true; } //重复密码验证 function checkPassWord3(val){ var newPassword = $("#newPassword").val(); if(val.length<1){ $("#newPasswordType2").html("密码不能为空"); $("#newPasswordType2").css("color","red"); return false; } if(val != newPassword){ $("#newPasswordType2").html("两次密码不一致"); $("#newPasswordType2").css("color","red"); return false; } $("#newPasswordType2").html(""); return true; } function GetUser () { return JSON.parse(localStorage.getItem('User')); } $(function () { if (GetUser()!=null) { $("#username").val(GetUser().realname) $("#identitycode").val(GetUser().identityCode) $("#mobile").val(GetUser().mobile) $("#mail").val(GetUser().mail) $("#initialPassword").val(GetUser().password) } $('.sgsqieh ul li').each(function(i){ $(this).click(function(){ $('.sgsqieh ul li').removeClass('onsgstie'); $(this).addClass('onsgstie'); }) }); //用户名 $("#username").blur(function(){ checkUserName($(this).val()); }); //身份证 $("#identitycode").blur(function(){ checkUpdataEnergyCard(this); }); //手机号 $("#mobile").blur(function(){ checkMobile($(this).val()); }); //邮箱地址 $("#mail").blur(function(){ checkMail($(this).val()); }); //密码 $("#oldPassword").blur(function(){ checkPassWord($(this).val()); }); //新密码 $("#newPassword").blur(function(){ checkPassWord2($(this).val()); }); //重复密码 $("#newPassword2").blur(function(){ checkPassWord3($(this).val()); }); $("#xgmm").click(function(){ $('.zcone').hide(); $('.zctwo').show(); }); $("#jbxx").click(function(){ $('.zcone').show(); $('.zctwo').hide(); }); }) function tijiaoxinxi(){ if (GetUser()==null) { alert('请登录后操作') return } var id=$("#id").val(); var userName= $("#username").val(); var mobile =$("#mobile").val(); var identityCode=$("#identitycode").val(); var mail =$("#mail").val(); if(checkUserName($('#username').val()) && checkUpdataEnergyCard($('#identitycode')) && checkMobile($("#mobile").val()) && checkMail($("#mail").val()) ){ var formJson = { id:GetUser().id, realname:userName, mobile:mobile, identityCode:identityCode, mail:mail }; var url = "getEditUser"; ajaxJsonNotAsync(url, formJson,function (data) { console.log(data) if(data[0].code == 0){ localStorage.removeItem('User') window.location.href = $("#shouye_dl").attr("href") }else{ alert(data[0].msg) } }); } } function tijiaomima(){ if (GetUser()==null) { alert('请登录后操作') return } if (level != 1) { alert("密码强度较低,请重新输入密码!"); return false; } var password =$("#oldPassword").val(); var npd=$("#newPassword").val(); var newPassword2 =$("#newPassword2").val(); if(checkPassWord(password) && checkPassWord2(newPassword) && checkPassWord3(newPassword2)){ var formJson = { npd:npd, loginName:GetUser().loginName, id:GetUser().id }; var url = "getEditPassword"; ajaxJsonNotAsync(url, formJson, function (data) { console.log(data) if(data[0].code == 0){ localStorage.removeItem('User') window.location.href = $("#shouye_dl").attr("href") }else{ alert(data[0].msg) } }); } } //密码强度级别 var level = 0; function pwdStrength(pwd) { level = myPwdStrength(pwd); } var ip = 'http://www.kfcredit.gov.cn/kfxypt/registerController.do?' function ajaxJsonNotAsync(url, postData, callBack) { try { jQuery.ajax({ type: 'get', dataType: "json", url: ip+url, data: postData, cache: true, async: false, success: function (data) { //console.log(data) // Loading(false); callBack(data); }, error: function (data) { //console.log(data) console.log(ip+url) // Loading(false); //alert(data.responseText, -1); console.error("异常:" + data.responseText); } }); } catch (e) { //alert(e.message, -1); } } </script> </body> </html>