// JScript //alert('x'); //var cmeUrl="http://cme.91huayi.com/secure/LoginHandler.ashx"; var cmeUrl="http://cme.91huayi.com/secure/LoginHandler_v3.ashx"; var cmeDataCountUrl="http://hyservice.91huayi.com/hy_service/Hy_GetUserCount.ashx"; var cmeUrl_new="http://cme.91huayi.com/ashx/LoginHandler_v4.ashx"; var cmeUrl_new1="http://cme1.91huayi.com/secure/LoginHandler_v3.ashx"; var cmeUrl_new2="http://cme2.91huayi.com/secure/LoginHandler_v3.ashx"; var cmeUrl_new3="http://cme3.91huayi.com/secure/LoginHandler_v3.ashx"; $(document).ready(function(){ var loginName=getCookie("rememberName"); var loginPwd=getCookie("rememberPwd"); var login_id_=getCookie("rememberUserID"); Getuserintegrallevel(login_id_,1,2); if(loginName!=null && loginName!="") { $("#userName").val(loginName); } if(loginPwd!=null && loginPwd!="") { $("#userPwd").val(loginPwd); } var loginedUserName=getCookie("rememberLoginUser"); if(loginedUserName!="" && loginedUserName!=null) { /* $(".login").hide(); $(".login_error").hide(); $(".dfhdgdg").hide(); $(".tele").hide(); $(".index_zc").hide(); // 3 button $(".logined").show();*/ $("#loginx").hide(); $("#comUserName").html(loginedUserName); document.getElementById('updataPwd').href="http://hyuser.91huayi.com/AccountCenter/setpwd.aspx?tag=91huayi&uid="+getCookie("rememberUserID")+"&user_name="+loginName; document.getElementById('updateUinfo').href="http://hyuser.91huayi.com/AccountCenter/modifyAccount.aspx?tag=91huayi&uid="+getCookie("rememberUserID"); //document.getElementById('gocmelogin').href="http://cme.91huayi.com/secure/regConfirmation.aspx?uid="+getCookie("rememberUserID"); document.getElementById('gocmelogin').href="http://cme.91huayi.com/cme.html"; //document.getElementById('headCmeLink').href="http://cme.91huayi.com/secure/regConfirmation.aspx?uid="+getCookie("rememberUserID"); document.getElementById('headCmeLink').href="http://cme.91huayi.com/cme.html"; } $.ajax({ url: cmeDataCountUrl, dataType:"jsonp", jsonp:"jsonpcallback", success: function (data) { var json = eval(data); $.each(json, function (id, item) { if(id=="regstuNum") { $("#LabRegstuNum").html(item); $("#LabRegstuNum2").html(item); //$("#LabRegstuNum").html("1029871"); } if(id=="stuNum") { $("#LabHospNum").html(item); $("#LabHospNum2").html(item); //$("#LabHospNum").html("5728"); } if(id=="hospNum") { $("#LabStuNum").html(item); $("#LabStuNum2").html(item); //$("#LabStuNum").html("77516"); } }) } }) /* $("#KSS_content>a:nth-child(2)").bind("click",function(){ var userID=getCookie("rememberUserID"); var userName=getCookie("rememberLoginUser"); if (userName!=null) { this.href='http://thanks.91huayi.com/Home/Thank?userID='+userID+'&userName='+encodeURI(userName); } else { this.href='http://thanks.91huayi.com/Home/Thank'; } });*/ $("#xmen").bind("click",function(){ var userID=getCookie("rememberUserID"); var userName=getCookie("rememberLoginUser"); if (userName!=null) { this.href='http://thanks.91huayi.com/Home/Thank?userID='+userID+'&userName='+encodeURI(userName); } else { this.href='http://thanks.91huayi.com/Home/Thank'; } }); }); function writeInfo() { if($("#checkInfo").attr("checked")==true) { var uName=$("#userName").val(); var uPwd=$("#userPwd").val(); writeCookie("rememberName",uName); writeCookie("rememberPwd",uPwd); } } function deletInfo() { delCookie("rememberName"); delCookie("rememberPwd"); } function loginOut() { delCookie("rememberLoginUser"); $("#userPwd").val(""); $(".login").show(); // $(".dfhdgdg").show(); // $(".tele").show(); $(".logined").hide(); // document.getElementById('headCmeLink').href="http://cme.91huayi.com"; // location.href="http://sso.91huayi.com/sso/logout_all.aspx?url=http://www.91huayi.com"; } function aloneLogin() { if($("#checkInfo").attr("checked")==true) { writeInfo(); } else { deletInfo(); } var loginName = $("#userName").val(); var loginPwd = $("#userPwd").val(); if(loginName=="" || loginName=="左侧可选择登录方式" ) { alert("请输入用户名"); return; } if(loginPwd=="") { alert("请输入密码"); return; } $.ajax({ url: cmeUrl, dataType:"jsonp", data: { UserName: loginName, Password: loginPwd, loginType: "1" }, jsonp:"jsonpcallback", beforeSend: loading, success: function (data) { var json = eval(data); var backuser = ""; $.each(json, function (id, item) { if(id=="msg") { if(item!="error") { writeCookie("rememberLoginUser",item); $(".login").hide(); $(".login_error").hide(); //$(".dfhdgdg").hide(); $(".index_zc").hide(); // 3 button $(".dfhdgdg").hide(); // 3 count $(".tele").hide(); $(".logined").show(); $("#comUserName").html(item); } else { alert("您输入的账号或密码错误!"); return; } } else if(id=="uid") { writeCookie("rememberUserID",item); window.location.href='index.html'; } else { alert("您输入的账号或密码错误!"); } }) } }) } function Getuserintegrallevel(sid, startnumber, type) { var reg = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/; var reg1 = /^[0-9]*[1-9][0-9]*$/; if (!reg.test(sid)) { //alert("请输入有效的参数"); return false; } if (!reg1.test(startnumber)) { //alert("请输入有效的参数"); return false; } $.ajax({ type: "GET", url: "http://jifen.91huayi.com/home/Getuserintegrallevel", data: { sid: sid, startnumber: startnumber, zip: Math.random() }, cache: false, error: function () { //alert("程序出错,请联系管理员."); return false; }, dataType: "jsonp", jsonp: 'callback', beforeSend: function () { $("#page_net img").attr("src", "http://www.91huayi.com/huayi_yidou/images/page_loading.gif"); }, success: function (msg) { if (msg != null) { if (msg.success == true) { //头像 if (msg.img != null && msg.img != "") { $(".g-sd1-1 img").attr("src", msg.img); } //加载用户信息 $("#comUserName_jf").html(msg.integral); $("#comUserName_dj").html(msg.level); $("#my_yd").attr("href", "http://www.91huayi.com/huayi_yidou.html?id="+sid); } else { alert(msg.message); return false; } } } }); } function loginFun() { if($("#checkInfo").attr("checked")==true) { writeInfo(); } else { deletInfo(); } var loginName = $("#userName").val(); // 进行 base64 编码 var loginPwd = $("#userPwd").val(); // 进行 base64 编码 // var loginTypeValue = getSelectValue("selectLoginType"); // 获取登录类型 var loginTypeValue = $("#selectLoginType").val(); // 获取登录类型 if(loginName=="" || loginName=="左侧可选择登录方式" ) { alert("请输入用户名"); return; } if(loginPwd=="") { alert("请输入密码"); return; } $.ajax({ url: cmeUrl, dataType:"jsonp", // data: { UserName: loginName , Password: $.base64.encode(loginPwd), loginType: loginTypeValue }, data:{UserName:loginName,Password: $.base64.encode(loginPwd), loginType: 1}, jsonp:"jsonpcallback", beforeSend: loading, success: function (data) { var json = eval(data); var backuser = ""; $.each(json, function (id, item) { if(id=="msg") { //if(item!="error") //{ // writeCookie("rememberLoginUser",item); // $(".login").hide(); // $(".login_error").hide(); // $(".index_zc").hide(); // 3 button // $(".dfhdgdg").hide(); // 3 count // $(".tele").hide(); // $(".logined").show(); // $("#comUserName").html(item); //} // //if (backuser == "" || backSeesion == "") { // $("#logindiv").empty(); // $("#logindiv").html(loginhtml); // GetFocus($("#loginAccessName")); //} if (item == "01") { // $("#login_error").html("用户名或密码错误"); alert("用户名或密码错误"); } else if (item == "0") { // $("#login_error").html("用户名或密码错误"); alert("用户名或密码错误"); } else if (item == "1") { // $("#login_error").html("用户名或密码错误"); alert("用户名或密码错误"); } else if (item == "2") { // $("#login_error").html("手机号或密码错误"); alert("用户名或密码错误"); } else if (item == "3") { // $("#login_error").html("手机号或密码错误"); alert("用户名或密码错误"); } else if (item == "4") { // $("#login_error").html("您输入的手机号多人共用"); alert("用户名或密码错误"); } else if (item == "5") { // $("#login_error").html("邮箱或密码错误"); alert("用户名或密码错误"); } else if (item == "6") { // $("#login_error").html("邮箱或密码错误"); alert("用户名或密码错误"); } else if (item == "7") { // $("#login_error").html("您输入的邮箱多人共用"); alert("用户名或密码错误"); } else if (item == "8") { // $("#login_error").html("身份证或密码错误"); alert("用户名或密码错误"); } else if (item == "9") { // $("#login_error").html("身份证或密码错误"); alert("用户名或密码错误"); } else if (item == "10") { // $("#login_error").html("您输入的身份证多人共用"); alert("用户名或密码错误"); } else { $("#loginx").hide(); // 登录成功 开始 writeCookie("rememberLoginUser",item); /* $(".login").hide(); $(".login_error").hide(); $(".index_zc").hide(); // 3 button $(".dfhdgdg").hide(); // 3 count $(".tele").hide(); $(".login_after").show(); */ $("#comUserName").html(item); // 登录成功 结束 } // //else //{ //alert("您输入的账号或密码错误!"); // $("#login_error").html("您输入的账号或密码错误!"); //} } else if(id=="uid") { //获取学员积分、学员等级 Getuserintegrallevel(item,1,2); writeCookie("rememberUserID",item); document.getElementById('updataPwd').href="http://hyuser.91huayi.com/AccountCenter/setpwd.aspx?tag=91huayi&uid="+item+"&user_name="+loginName; document.getElementById('updateUinfo').href="http://hyuser.91huayi.com/AccountCenter/modifyAccount.aspx?tag=91huayi&uid="+item; //document.getElementById('gocmelogin').href="http://cme.91huayi.com/secure/regConfirmation.aspx?uid="+item; //document.getElementById('gocmelogin').href="http://cme.91huayi.com/cme.html"; //document.getElementById('headCmeLink').href="http://cme.91huayi.com/secure/regConfirmation.aspx?uid="+item; //document.getElementById('headCmeLink').href="http://cme.91huayi.com"; // 2011-11-20 sso begin ------------------------------- var ifr; try { ifr = document.createElement(''); } catch (ex) { ifr = document.createElement('iframe'); } ifr.id = 'sso_iframe'; ifr.name = 'sso_iframe'; ifr.width = 0; ifr.height = 0; ifr.marginHeight = 0; ifr.marginWidth = 0; ifr.src = 'http://sso.91huayi.com/sso/login_all.ashx?username=' + loginName +'&password='+ loginPwd +'&loginType=1&from=91huayi'; document.body.appendChild(ifr); // 2011-11-20 sso end ---------------------------------- } else { alert("您输入的账号或密码错误!"); } }) } }) } function checkCode() { var myDate = new Date(); document.getElementById("imgCheckCode").src = "http://cme.91huayi.com/secure/CheckCode.aspx?id=" + myDate.toLocaleTimeString(); } function loginFun_new() { if($("#checkInfo").attr("checked")==true) { writeInfo(); } else { deletInfo(); } var loginName = $("#userName").val(); // 进行 base64 编码 var loginPwd = $("#userPwd").val(); // 进行 base64 编码 var xx=$("#loginAccessPwd2").val(); // var loginTypeValue = getSelectValue("selectLoginType"); // 获取登录类型 var loginTypeValue = $("#selectPopLoginType").val(); // 获取登录类型 if(loginName=="" || loginName=="左侧可选择登录方式" ) { alert("请输入用户名"); return; } if(loginPwd=="") { alert("请输入密码"); return; } if(xx=="") { alert("验证码不可为空"); return ; } $.ajax({ url:cmeUrl_new, dataType:"jsonp", // data: { UserName: loginName , Password: $.base64.encode(loginPwd), loginType: loginTypeValue }, data:{UserName:loginName,Password: $.base64.encode(loginPwd), loginType:loginTypeValue,code:xx}, jsonp:"jsonpcallback", beforeSend: loading, success: function (data) { var json = eval(data); var backuser = ""; $.each(json, function (id, item) { if(id=="msg") { //if(item!="error") //{ // writeCookie("rememberLoginUser",item); // $(".login").hide(); // $(".login_error").hide(); // $(".index_zc").hide(); // 3 button // $(".dfhdgdg").hide(); // 3 count // $(".tele").hide(); // $(".logined").show(); // $("#comUserName").html(item); //} // //if (backuser == "" || backSeesion == "") { // $("#logindiv").empty(); // $("#logindiv").html(loginhtml); // GetFocus($("#loginAccessName")); //} if (item == "01") { // $("#login_error").html("用户名或密码错误"); alert("用户名或密码错误"); } else if(item=="00") { alert("验证码填写错误"); } else if (item == "0") { // $("#login_error").html("用户名或密码错误"); alert("用户名或密码错误"); } else if (item == "1") { // $("#login_error").html("用户名或密码错误"); alert("用户名或密码错误"); } else if (item == "2") { // $("#login_error").html("手机号或密码错误"); alert("用户名或密码错误"); } else if (item == "3") { // $("#login_error").html("手机号或密码错误"); alert("用户名或密码错误"); } else if (item == "4") { // $("#login_error").html("您输入的手机号多人共用"); alert("用户名或密码错误"); } else if (item == "5") { // $("#login_error").html("邮箱或密码错误"); alert("用户名或密码错误"); } else if (item == "6") { // $("#login_error").html("邮箱或密码错误"); alert("用户名或密码错误"); } else if (item == "7") { // $("#login_error").html("您输入的邮箱多人共用"); alert("用户名或密码错误"); } else if (item == "8") { // $("#login_error").html("身份证或密码错误"); alert("用户名或密码错误"); } else if (item == "9") { // $("#login_error").html("身份证或密码错误"); alert("用户名或密码错误"); } else if (item == "10") { // $("#login_error").html("您输入的身份证多人共用"); alert("用户名或密码错误"); } else if (backuser == "00") { alert("验证码错误!请重新输入"); checkCode(); GetFocus($("#loginAccessPwd1")); } else { $("#loginx").hide(); // 登录成功 开始 writeCookie("rememberLoginUser",item); /* $(".login").hide(); $(".login_error").hide(); $(".index_zc").hide(); // 3 button $(".dfhdgdg").hide(); // 3 count $(".tele").hide(); $(".login_after").show(); */ $("#comUserName").html(item); // 登录成功 结束 } // //else //{ //alert("您输入的账号或密码错误!"); // $("#login_error").html("您输入的账号或密码错误!"); //} } else if(id=="uid") { //获取学员积分、学员等级 Getuserintegrallevel(item,1,2); writeCookie("rememberUserID",item); document.getElementById('updataPwd').href="http://hyuser.91huayi.com/AccountCenter/setpwd.aspx?tag=91huayi&uid="+item+"&user_name="+loginName; document.getElementById('updateUinfo').href="http://hyuser.91huayi.com/AccountCenter/modifyAccount.aspx?tag=91huayi&uid="+item; //document.getElementById('gocmelogin').href="http://cme.91huayi.com/secure/regConfirmation.aspx?uid="+item; //document.getElementById('gocmelogin').href="http://cme.91huayi.com/cme.html"; //document.getElementById('headCmeLink').href="http://cme.91huayi.com/secure/regConfirmation.aspx?uid="+item; //document.getElementById('headCmeLink').href="http://cme.91huayi.com"; // 2011-11-20 sso begin ------------------------------- var ifr; try { ifr = document.createElement(''); } catch (ex) { ifr = document.createElement('iframe'); } ifr.id = 'sso_iframe'; ifr.name = 'sso_iframe'; ifr.width = 0; ifr.height = 0; ifr.marginHeight = 0; ifr.marginWidth = 0; ifr.src = 'http://sso.91huayi.com/sso/login_all.ashx?username=' + loginName +'&password='+ loginPwd +'&loginType=1&from=91huayi'; document.body.appendChild(ifr); // 2011-11-20 sso end --------------------------------- } else if(id=="ifCanBuyCard") { if(item=="0"){ $("#xxxx").css("display","none"); } if(item=="1") { $("#xxxx").css("display","block"); } } else { alert("您输入的账号或密码错误!"); } }) try { $.ajax({ url:cmeUrl_new1, dataType:"jsonp", // data: { UserName: loginName , Password: $.base64.encode(loginPwd), loginType: loginTypeValue }, data:{UserName:loginName,Password: $.base64.encode(loginPwd), loginType: 1,code:xx}, jsonp:"jsonpcallback", beforeSend: loading, success: function (data) {}}); $.ajax({ url:cmeUrl_new2, dataType:"jsonp", // data: { UserName: loginName , Password: $.base64.encode(loginPwd), loginType: loginTypeValue }, data:{UserName:loginName,Password: $.base64.encode(loginPwd), loginType: 1,code:xx}, jsonp:"jsonpcallback", beforeSend: loading, success: function (data) {}}); $.ajax({ url:cmeUrl_new3, dataType:"jsonp", // data: { UserName: loginName , Password: $.base64.encode(loginPwd), loginType: loginTypeValue }, data:{UserName:loginName,Password: $.base64.encode(loginPwd), loginType: 1,code:xx}, jsonp:"jsonpcallback", beforeSend: loading, success: function (data) {}}); }catch(e){} } }) } function loading() { $("#butLogin").val("正在登录.."); } function writeCookie(key, value) { var sExpires = new Date(); sExpires.setTime(sExpires.getTime() + 24 * 60 * 60 * 1000); setCookie(key, value, "", "/", sExpires.toGMTString(), ""); if (getCookie(key) == null) { setCookie(key, value, "", "/", sExpires.toGMTString(), ""); } } function getCookie(sKey) { var sCookie = document.cookie; if (!sCookie) return null; var sTag = sKey + "="; var iBegin = sCookie.indexOf(sTag); if (iBegin < 0) return null; iBegin += sTag.length; var iEnd = sCookie.indexOf(";", iBegin); if (iEnd < 0) iEnd = sCookie.length; return sCookie.substring(iBegin, iEnd); } function setCookie(sKey, sValue, sDomain, sPath, sExpires, blSecure) { var sCookieStr = sKey + "=" + sValue + ";"; if (sDomain) sCookieStr += " DOMAIN=" + sDomain + ";"; if (sPath) sCookieStr += " PATH=" + sPath + ";"; if (sExpires) sCookieStr += " EXPIRES=" + sExpires + ";"; if (blSecure) sCookieStr += " SECURE"; document.cookie = sCookieStr; } function delCookie(name) { var exp = new Date(); exp.setTime(exp.getTime() - 1); var cval = getCookie(name); if (cval != null) document.cookie = name + "=" + cval + ";path=/;expires=" + exp.toGMTString(); } function getSelectValue(name) { var obj = document.getElementById(name); return obj.value; }