;(function($){ // ---------------------------------------------------------------------- // // 限制只能输入数字 // // ---------------------------------------------------------------------- $.fn.onlyNum = function () { $(this).keypress(function (event) { var eventObj = event || e; var keyCode = eventObj.keyCode || eventObj.which; if ((keyCode >= 48 && keyCode <= 57)) return true; else return false; }).focus(function () { //禁用输入法 this.style.imeMode = 'disabled'; }).bind("paste", function () { //获取剪切板的内容 var clipboard = window.clipboardData.getData("Text"); if (/^\d+$/.test(clipboard)) return true; else return false; }); }; // ---------------------------------------------------------------------- // // 限制只能输入字母 // // ---------------------------------------------------------------------- $.fn.onlyAlpha = function () { $(this).keypress(function (event) { var eventObj = event || e; var keyCode = eventObj.keyCode || eventObj.which; if ((keyCode >= 65 && keyCode <= 90) || (keyCode >= 97 && keyCode <= 122)) return true; else return false; }).focus(function () { this.style.imeMode = 'disabled'; }).bind("paste", function () { var clipboard = window.clipboardData.getData("Text"); if (/^[a-zA-Z]+$/.test(clipboard)) return true; else return false; }); }; // ---------------------------------------------------------------------- // // 限制只能输入数字和字母,允许下划线95 // // ---------------------------------------------------------------------- $.fn.onlyNumAlpha = function () { $(this).keypress(function (event) { var eventObj = event || e; var keyCode = eventObj.keyCode || eventObj.which; if ((keyCode >= 48 && keyCode <= 57) || (keyCode >= 65 && keyCode <= 90) || (keyCode >= 97 && keyCode <= 122) || keyCode == 95) return true; else return false; }).focus(function () { //ie,ff, not chrome this.style.imeMode = 'disabled'; }).bind("paste", function () { var clipboard = window.clipboardData.getData("Text"); if (/^(\d|[a-zA-Z_])+$/.test(clipboard)) return true; else return false; }); }; $(function(){ $(".onlyNum").onlyNum(); $(".onlyAlpha").onlyAlpha(); $(".onlyNumAlpha").onlyNumAlpha(); }); })(jQuery); $(function() { $('#slider').cycle({ fx: 'scrollLeft', timeout: 4100, speed:500, pager: '#cyclenav' }); //新疆新需求:查找承诺书 if(para_val == "98812"){ getCommitmentContent(); } }); $(document).ready(function() { //针对山西:判断如未确认协议,退出到未登录状态(二次判断,防止还未确认协议就刷新页面) if(para_val == "92416"){ $.ajax({ url : '../../pmos/rest/baMarketparticipantInfo/checkShanxiIfConfirm', type : 'get', async: false, success : function(rc) { if(rc) { if(rc.state == 0){//不存在数据 $.ajax({ url : '../logOutServlet', type : 'post', data : "time=" + new Date().getTime() , dataType : 'text', success : function() { //退出成功 } }); } } } }); } $(".login_button").bind("click",function(){ login(publicKeyExponent,publicKeyModulus); }); $(".matketDiv").mouseDelay('300').hover(function () { $(".matketDiv").show(); }, function () { $(".matketDiv").hide(); }); $(".logoDiv02").mouseDelay('300').hover(function () { $(".matketDiv").show(); }, function () { $(".matketDiv").hide(); }); getLoginUser();//登录信息 changeLogo(para_val,marketName);//根据场景切换网站logo //鼠标滑过插件下载按钮有变化 $("#a_loadexe_id").mouseover(function(){ $(this).addClass("first_bo_link"); }); //判断是否为IE浏览器 $("#zhuye").click(function(){ if ((navigator.userAgent.indexOf('MSIE') >= 0) && (navigator.userAgent.indexOf('Opera') < 0)){ // alert('你是使用IE') }else{ alert('您的浏览器可能不支持自动设置主页,请手动设置'); } }); //判断是否为IE浏览器 $("#shoucang").click(function(){ if ((navigator.userAgent.indexOf('MSIE') >= 0) && (navigator.userAgent.indexOf('Opera') < 0)){ // alert('你是使用IE') }else{ // $.messager.alert('消息', '数据已加载,请勿频繁操作!'); alert('您的浏览器可能不支持自动加入收藏,请手动设置'); } }); if(formart == '1'){ //当为1时候添加id,来设置对应的样式 if(piccode=="1"){ $('.wjmm').attr('id','wjmm'); }else{ $('.wjmm').attr('id','wjmm1'); } $(".login_check").hide(); $(".login_all").show(); $(".login_all").find('#loginname').focus(); } showDq(); }); /** * 获取登录信息 * @param type */ function getLoginUser(){ $.ajax({ url : '../UserInfoServlet', data : '' , dataType : 'json', type : 'post', success : function(result) { var userName = null==result?"":result.userName; if(null==userName||"null"==userName||""==userName||undefined==userName){ if(pmosSSO == "TRUE"){ $(".li04").html("请登录"); //$(".li04").html("请登录"); }else{ $(".li04").html("请登录"); } }else{ var li04Width=(GetStringByteLength(userName)+3)*6; $(".li04").width(li04Width); $(".li04").html(""+userName+""); $(".li03").html("我的主页"); $(".li02").addClass("li02_out"); $(".li02_out").html("退出"); document.getElementById("yonghu").style.display="none"; } } }); } /** * 维护公告控制 */ function showDq(){ $.ajax({ url:'../../pmos/rest/menuManageController/findq', type:'post', contentType: "application/json", dataType:'json', success:function(data){ if(data.resultValue.items.length==0){ $(".overhaul").hide(); $(".overhaul_bg").hide(); $(".overhaul_h1").hide(); $(".overhaul_h2").hide(); $(".overhaul_h3").hide(); $(".overhaul_h4").hide(); $(".overhaul_t").hide(); $(".closeDiv").hide(); }else{ if(data.successful){ var itemData=data.resultValue.items; for(var i=0;i"); $(".overDiv01").html(""); $('.overhaul_t').html(qsydtitle); $('.overhaul_h1').html(qnotice); var dom=document.getElementById("overhaul_bg"); dom.setAttribute("style","position: absolute;width: 100%;height: 950px;top: -16px;background-color: #000000;filter:alpha(opacity:30);opacity:0.3;text-align: center;z-index: 99999999997;") }else{ $(".overhaul").hide(); $(".overhaul_bg").hide(); $(".overhaul_h1").hide(); $(".overhaul_h2").hide(); $(".overhaul_h3").hide(); $(".overhaul_h4").hide(); $(".overhaul_t").hide(); $(".closeDiv").hide(); } } } } } }); } /** * 关闭按钮点击事件 */ function hit(){ //alert(11111); $(".overhaul").hide(); $(".overhaul_bg").hide(); $(".overhaul_h1").hide(); $(".overhaul_h2").hide(); $(".overhaul_h3").hide(); $(".overhaul_h4").hide(); $(".overhaul_t").hide(); $(".closeDiv").hide(); } /** * 根据场景切换logo标识 * @param para_value */ function changeLogo(para_val,marketName){ if(para_val == '91812'){//总部场景 $("#selectLogo").attr("style","background:url('../skins/green/images/LogoPic/logo2.png') ");//切换北京电力交易中心logo $("#logoTS").text("北京电力交易中心");//网站右上角提示 如“北京电力交易中心” $("#logoTS1").text("信息发布网站");//网站右上角提示 “信息发布网站” $("#logoli01").text("北京电力交易中心");//logo图标旁边定位 document.getElementById('logoli01').style.width="130px"; }else if(para_val == '92212'){//天津场景 $("#selectLogo").attr("style","background:url('../skins/green/images/LogoPic/logo_TJ.png') "); document.getElementById('logoli01').style.width="130px"; $("#logoTS").text(marketName+"交易中心");//网站右上角提示 如“北京电力交易中心” $("#logoTS1").text("信息发布网站");//网站右上角提示 “信息发布网站” $("#logoli01").text(marketName); document.getElementById('logoli01').style.width="76px"; }else if(para_val == '95412'){//江苏场景 $("#selectLogo").attr("style","background:url('../skins/green/images/LogoPic/logo_JS.png') "); document.getElementById('logoli01').style.width="76px"; }else if(para_val == '95321'){//上海 $("#selectLogo").attr("style","background:url('../skins/green/images/LogoPic/logo_shanghai.png') "); //切换总部logo document.getElementById('logoli01').style.width="130px"; $("#logoTS").text(marketName+"交易中心");//网站右上角提示 如“北京电力交易中心” $("#logoTS1").text("电力交易平台");//网站右上角提示 “信息发布网站” $("#logoli01").text(marketName); document.getElementById('logoli01').style.width="76px"; } else if(para_val == '95612'){//安徽 $("#selectLogo").attr("style","background:url('../skins/green/images/LogoPic/logo_anhui.png') "); //切换总部logo document.getElementById('logoli01').style.width="130px"; $("#logoTS").text(marketName+"交易中心");//网站右上角提示 如“北京电力交易中心” $("#logoTS1").text("电力交易平台");//网站右上角提示 “信息发布网站” $("#logoli01").text(marketName); document.getElementById('logoli01').style.width="76px"; } else if(para_val == '98812'){//新疆 $("#selectLogo").attr("style","background:url('../skins/green/images/LogoPic/logo_xinjiang.png') "); //切换总部logo document.getElementById('logoli01').style.width="130px"; $("#logoTS").text(marketName+"交易中心");//网站右上角提示 如“北京电力交易中心” $("#logoTS1").text("电力交易平台");//网站右上角提示 “信息发布网站” $("#logoli01").text(marketName); document.getElementById('logoli01').style.width="76px"; }else if(para_val == '98712'){//青海 $("#selectLogo").attr("style","background:url('../skins/green/images/LogoPic/logo_qinghai.png') "); //切换总部logo document.getElementById('logoli01').style.width="130px"; $("#logoTS").text(marketName+"交易中心");//网站右上角提示 如“北京电力交易中心” $("#logoTS1").text("电力交易平台");//网站右上角提示 “信息发布网站” $("#logoli01").text(marketName); document.getElementById('logoli01').style.width="76px"; }else if(para_val == '94004'){//辽宁 $("#selectLogo").attr("style","background:url('../skins/green/images/LogoPic/logo_liaoning.png') "); //切换总部logo document.getElementById('logoli01').style.width="130px"; $("#logoTS").text(marketName+"交易中心");//网站右上角提示 如“北京电力交易中心” $("#logoTS1").text("电力交易平台");//网站右上角提示 “电力交易平台” $("#logoli01").text(marketName); document.getElementById('logoli01').style.width="76px"; }else if(para_val == '95812'){//山东 $("#selectLogo").attr("style","background:url('../skins/green/images/LogoPic/logo_shandong.png') "); //切换总部logo document.getElementById('logoli01').style.width="130px"; $("#logoTS").text(marketName+"交易中心");//网站右上角提示 如“北京电力交易中心” $("#logoTS1").text("电力交易平台");//网站右上角提示 “电力交易平台” $("#logoli01").text(marketName); document.getElementById('logoli01').style.width="76px"; }else if(para_val == '93412'){//江西 $("#selectLogo").attr("style","background:url('../skins/green/images/LogoPic/logo_jiangxi.png') "); //切换总部logo document.getElementById('logoli01').style.width="130px"; $("#logoTS").text(marketName+"交易中心");//网站右上角提示 如“北京电力交易中心” $("#logoTS1").text("电力交易平台");//网站右上角提示 “电力交易平台” $("#logoli01").text(marketName); document.getElementById('logoli01').style.width="76px"; } else if(para_val == '92416'){//山西 $("#selectLogo").attr("style","background:url('../skins/green/images/LogoPic/logo_shanxi2.png') "); //切换总部logo document.getElementById('logoli01').style.width="130px"; $("#logoTS").text(marketName+"交易中心");//网站右上角提示 如“北京电力交易中心” $("#logoTS1").text("电力交易平台");//网站右上角提示 “电力交易平台” $("#logoli01").text(marketName); document.getElementById('logoli01').style.width="76px"; }else if(para_val == '92652'){//北京(首都) $("#selectLogo").attr("style","background:url('../skins/green/images/LogoPic/logo_shoudu.png') "); //切换总部logo document.getElementById('logoli01').style.width="130px"; $("#logoTS").text("首都电力"+"交易中心");//网站右上角提示 如“北京电力交易中心” $("#logoTS1").text("电力交易平台");//网站右上角提示 “电力交易平台” $("#logoli01").text("首都电力"); document.getElementById('logoli01').style.width="76px"; }else if(para_val == '95518'){//浙江 $("#selectLogo").attr("style","background:url('../skins/green/images/LogoPic/logo_zhejiang.png') "); //切换总部logo document.getElementById('logoli01').style.width="130px"; $("#logoTS").text(marketName+"交易中心");//网站右上角提示 如“北京电力交易中心” $("#logoTS1").text("电力交易平台");//网站右上角提示 “电力交易平台” $("#logoli01").text(marketName); document.getElementById('logoli01').style.width="76px"; }else if(para_val == '962181'){//冀北 $("#selectLogo").attr("style","background:url('../skins/green/images/LogoPic/logo_jibei.png') "); //切换总部logo document.getElementById('logoli01').style.width="130px"; $("#logoTS").text(marketName+"交易中心");//网站右上角提示 如“北京电力交易中心” $("#logoTS1").text("电力交易平台");//网站右上角提示 “电力交易平台” $("#logoli01").text(marketName); document.getElementById('logoli01').style.width="76px"; }else if(para_val == '96218'){//重庆 $("#selectLogo").attr("style","background:url('./skins/green/images/LogoPic/logo_chongqing.png') "); //切换总部logo document.getElementById('logoli01').style.width="130px"; $("#logoTS").text(marketName+"交易中心");//网站右上角提示 如“北京电力交易中心” $("#logoTS1").text("微信公众号");//网站右上角提示 “电力交易平台” $("#logoli01").text(marketName); document.getElementById('logoli01').style.width="76px"; if(document.getElementById('logoDiv03') != null) { document.getElementById('logoDiv03').style.marginRight="102px"; } document.getElementById('logoTS1').style.marginLeft="26px"; //$("#logoDiv03").attr("style","marginLeft:102px"); }else if(para_val == '98611'){//宁夏 $("#selectLogo").attr("style","background:url('../skins/green/images/LogoPic/logo_ningxia.png') "); //切换总部logo document.getElementById('logoli01').style.width="130px"; $("#logoTS").text(marketName+"交易中心");//网站右上角提示 如“北京电力交易中心” $("#logoTS1").text("电力交易平台");//网站右上角提示 “电力交易平台” $("#logoli01").text(marketName); document.getElementById('logoli01').style.width="76px"; }else if(para_val == '11001'){//内蒙古东部电力交易中心 $("#selectLogo").attr("style","background:url('../skins/green/images/LogoPic/logo_mengdong.png');width:380px; "); //切换总部logo $("#logoTS").text("蒙东电力"+"交易中心");//网站右上角提示 如“北京电力交易中心” $("#logoTS1").text("电力交易平台");//网站右上角提示 “电力交易平台” $("#logoli01").text("蒙东电力"); document.getElementById('logoli01').style.width="70px"; }else if(para_val == '98412'){//陕西 $("#selectLogo").attr("style","background:url('../skins/green/images/LogoPic/logo_shanxi.png') "); //切换总部logo document.getElementById('logoli01').style.width="130px"; $("#logoTS").text(marketName+"交易中心");//网站右上角提示 如“北京电力交易中心” $("#logoTS1").text("电力交易平台");//网站右上角提示 “电力交易平台” $("#logoli01").text(marketName); $("#logoli01").text(marketName); document.getElementById('logoli01').style.width="76px"; }else if(para_val == '95712'){//福建 $("#selectLogo").attr("style","background:url('../skins/green/images/LogoPic/logo_fujian.png') "); //切福建logo document.getElementById('logoli01').style.width="130px"; $("#logoTS").text(marketName+"交易中心");//网站右上角提示 如“北京电力交易中心” $("#logoTS1").text("电力交易平台");//网站右上角提示 “电力交易平台” $("#logoli01").text(marketName); $("#logoli01").text(marketName); document.getElementById('logoli01').style.width="76px"; }else if(para_val == '94212'){//吉林 $("#selectLogo").attr("style","background:url('../skins/green/images/LogoPic/logo_jilin.png') "); //切换吉林logo document.getElementById('logoli01').style.width="130px"; $("#logoTS").text(marketName+"交易中心");//网站右上角提示 如“北京电力交易中心” $("#logoTS1").text("电力交易平台");//网站右上角提示 “电力交易平台” $("#logoli01").text(marketName); $("#logoli01").text(marketName); document.getElementById('logoli01').style.width="76px"; } else if(para_val == '93512'){//吉林 $("#selectLogo").attr("style","background:url('../skins/green/images/LogoPic/logo_hubei.png') "); //切换吉林logo document.getElementById('logoli01').style.width="130px"; $("#logoTS").text(marketName+"交易中心");//网站右上角提示 如“北京电力交易中心” $("#logoTS1").text("电力交易平台");//网站右上角提示 “电力交易平台” $("#logoli01").text(marketName); $("#logoli01").text(marketName); document.getElementById('logoli01').style.width="76px"; } else if(para_val == '92812'){//吉林 $("#selectLogo").attr("style","background:url('../skins/green/images/LogoPic/logo_hebei.png') "); //切换吉林logo document.getElementById('logoli01').style.width="130px"; document.getElementById('selectLogo').style.width="400px"; $("#logoTS").text(marketName+"交易中心");//网站右上角提示 如“北京电力交易中心” $("#logoTS1").text("电力交易平台");//网站右上角提示 “电力交易平台” $("#logoli01").text(marketName); $("#logoli01").text(marketName); document.getElementById('logoli01').style.width="76px"; }else if(para_val == '98512'){//吉林 $("#selectLogo").attr("style","background:url('../skins/green/images/LogoPic/logo_gansu.png') "); //切换吉林logo document.getElementById('logoli01').style.width="130px"; document.getElementById('selectLogo').style.width="400px"; $("#logoTS").text(marketName+"交易中心");//网站右上角提示 如“北京电力交易中心” $("#logoTS1").text("电力交易平台");//网站右上角提示 “电力交易平台” $("#logoli01").text(marketName); $("#logoli01").text(marketName); document.getElementById('logoli01').style.width="76px"; } else if(para_val == '94312'){//黑龙江 $("#selectLogo").attr("style","background:url('../skins/green/images/LogoPic/logo_heilongjiang.png') "); //切换吉林logo document.getElementById('logoli01').style.width="130px"; $("#logoTS").text(marketName+"交易中心");//网站右上角提示 如“北京电力交易中心” $("#logoTS1").text("微信公众号");//网站右上角提示 “电力交易平台” $("#logoli01").text(marketName); document.getElementById('logoli01').style.width="90px"; document.getElementById('selectLogo').style.width="405px"; if(document.getElementById('logoDiv03') != null) { document.getElementById('logoDiv03').style.marginRight="102px"; } document.getElementById('logoTS1').style.marginLeft="26px"; }else if(para_val == '93212'){//河南 $("#selectLogo").attr("style","background:url('../skins/green/images/LogoPic/logo_henan.png') "); //切换吉林logo document.getElementById('logoli01').style.width="140px"; $("#logoTS").text(marketName+"交易平台");//网站右上角提示 如“北京电力交易中心” $("#logoTS1").text("");//网站右上角提示 “电力交易平台” $("#logoli01").text(marketName+"交易中心"); $("#logoli01").text(marketName+"交易中心"); document.getElementById('logoli01').style.width="145px"; } else if(para_val == '93312'){//湖南 $("#selectLogo").attr("style","background:url('../skins/green/images/LogoPic/logo_hunan.png') "); //切换吉林logo document.getElementById('logoli01').style.width="130px"; $("#logoli01").text(marketName); document.getElementById('logoli01').style.width="76px"; } else{//公共场景 $("#selectLogo").attr("style","background:url('../skins/green/images/LogoPic/logo.png') ;width:202px;height:68px;"); //切换总部logo document.getElementById('selectLogo').style.marginLeft="60px"; $("#logoTS").text(marketName+"交易中心");//网站右上角提示 如“北京电力交易中心” $("#logoTS1").text("信息发布网站");//网站右上角提示 “信息发布网站” $("#logoli01").text(marketName); document.getElementById('logoli01').style.width="76px"; } } /***获取字符串字节数 */ function GetStringByteLength(val){ var Zhlength=0;// 全角 var Enlength=0;// 半角 for(var i=0;i=1||!!window.ActiveXObject || "ActiveXObject" in window) { $('.dlts').attr('id','dlts2'); } else{ $('.dlts').attr('id','dlts'); } }else{ $('.dlts').attr('id','dlts1'); } $(".dlts").html('正在登录,请稍等'); var userName = $("#loginname").val() ; var password = $("#loginpass").val() ; if(userName == null || userName == "" || $.trim(userName) == "") { $(".dlts").html("用户名不能为空") ; return; } if(password == null || password == "" || $.trim(password) == "") { $(".dlts").html("密码不能为空") ; return; } //验证码校验 if (!input4Onblur()&&piccode=="1") { $(".dlts").html("验证码错误") ; refreshCode(); return; } $("#lb").addClass("login_over"); var k1="012C2C9BA925FAF8045B2FD9B02A2664"; var k2="987KS98EHKAL0AFJJ32JDUEO973JK2"; var k3="8JSDBWOIU49IBE7DGSKDH5UDHENDJ4889"; //加密 // RSAUtils.setMaxDigits(200); // var key = new RSAUtils.getKeyPair(publicKeyExponent, "", publicKeyModulus); // // var userName = RSAUtils.encryptedString(key,userName); // var password = RSAUtils.encryptedString(key,password); var userName = strEnc(userName,k1,k2,k3); var password = strEnc(password,k1,k2,k3); var pmosC = strEnc(para_val,k1,k2,k3); var verifyCode = $("#code").val(); if(window.para_val=='95812'){//山东场景 //用于临时保存加密后数据,在关闭窗口或标签页之后将会删除这些数据 window.sessionStorage.clear(); window.sessionStorage.setItem("res", userName); window.sessionStorage.setItem("key", password); } //新疆需求:登录验证用户是否确认承诺书 20191127 var xjConfirmFlag = true;//新疆:已确认标识过程 if(para_val == "98812"){//新疆 //验证登录账号是否正确 $.ajax({ url : '../loginServlet', data : 'userName=' + userName + "&password=" + password + "&verifyCode=" + verifyCode+"&pmosC="+pmosC, async : false, dataType : 'json', type : 'post', success : function(result) { //验证码校验 if(result.isverifyCode == "NO") { $(".dlts").html("验证码错误") ; refreshCode(); return; } //判断用户是否已被锁 if(result.isLock == "YES") { $(".dlts").html("用户已被锁定,请联系管理员解锁") ; $("#lb").removeClass("login_over"); refreshCode(); return; } if(result.status == "success") {//账号对了,验证承诺书 var news = result.isnewcomers; //判断是否为新用户 var newcomers = false; //查找是否为新用户 $.ajax({ url :"../../pmos/rest/regist/saveConfirmCommitment", type : "post", async : false, dataType :"json", data : { 'userName':$("#loginname").val(), 'flag' : 1 }, success : function(data){ if(data.state != "success"){ newcomers = true; } } }); //查找用户是否已经确认承诺书 $.ajax({ url : '../../pmos/rest/regist/checkCommitmentIfConfirm', type : 'get', async: false, data : { 'userName':$("#loginname").val() }, success : function(rc) { if(rc) { if(rc.state == 0 && !newcomers){//老用户不存在数据 弹出承诺书确认框 //查找已发布承诺书 $.ajax({ url :"../../pmos/rest/regist/getCommitmentContent", type : "get", async: false, dataType :"json", success : function(data){ var nextPage = ""; var title = ""; if(data && data.length > 0){ if(data[0].XH == "1"){//市场风险提示书 nextPage = "registLetterxj.jsp?page=2&userName="+$("#loginname").val(); title = "市场风险提示书"; }else if(data[0].XH == "2"){//诚信承诺书 nextPage = "sincerityLetter.jsp?page=2&userName="+$("#loginname").val(); title = "诚信承诺书"; }else if(data[0].XH == "3"){//可再生能源消纳承诺书 nextPage = "renewableEnergyLetter.jsp?page=2&userName="+$("#loginname").val(); title = "可再生能源消纳承诺书"; }else if(data[0].XH == "4"){//平台使用承诺书 nextPage = "platUseLetter.jsp?page=2&userName="+$("#loginname").val(); title = "平台使用承诺书"; }else if(data[0].XH == "5"){//注册承诺书 nextPage = "registKnowxj.jsp?page=2&userName="+$("#loginname").val(); title = "注册承诺书"; } //全局弹出承诺书 if(nextPage){ $(".login_all").hide();//隐藏登录框 $("#lb").removeClass("login_over"); top.$.jBox("iframe:"+nextPage, { title: title, id:"commitPage", width: 850, height: 630, //showClose: false,//不显示右上角关闭窗口× buttons:{}, closed :function(){ //判断是否点确认 if(comfirmState == "yes"){ $.messager.alert("消息", "确认成功!"); //然后验证用户名和KEY是否绑定 if(result.isUseKey == "YES") { //需要证书验证 // if(false) { //KEY插件 var eDiv = document.createElement("div"); //eDiv.style.display = "none"; if (navigator.appName.indexOf("Internet") >= 0) { if (window.navigator.cpuClass == "x86") { eDiv.innerHTML = ""; } else { eDiv.innerHTML = ""; } } else { eDiv.innerHTML = ""; $("#a_loadexe_id").css("display",""); $("#a_loadexe_id").attr("href","./plugs/npCryptoKit.Standard.x86.exe") ; } document.body.appendChild(eDiv); var CryptoAgency = document.getElementById("CryptoAgent"); var CertSubjectDN ; try { //CertSubjectDN = CryptoAgency.SelectSignCertificate("", "CFCA") ; CertSubjectDN = CryptoAgency.SelectSignCertificate("", "") ; } catch(err) {} if(!CertSubjectDN) //如果证书不存在 { var LastErrorDesc ; try { LastErrorDesc = CryptoAgency.GetLastErrorDesc(); } catch(e){} $(".login_all").show();//显示登录框 if(LastErrorDesc) { $(".dlts").html(LastErrorDesc); } else { $(".dlts").html("请先安装插件,然后插入证书使用") ; } $("#lb").removeClass("login_over"); refreshCode(); return false; } else { var selectedAlg = "sha-1"; var Signature = CryptoAgency.SignMessage(userName, selectedAlg); //加密 //因签名后的字符串中含有"+",提交到后台后如果不处理会变成" ",所以用",,,"替换"+",后台再用"+"替换",,," var sendData = 'username=' + userName + "&signUserName=" + Signature.replace(/\+/g,",,,") ; $.ajax({ url : '../loginCfcaServlet', data : sendData, dataType : 'json', type : 'post', success : function(result) { if(result.status == "true"){ if(news=="1"){//新手上路 $.ajax({ url : '../../pmos/rest/common/getInitInfo', type : 'get', success : function(rc) { if (rc.successful) { participanttype = rc.resultValue.participanttype; if (participanttype != "1") { window.location.href = "newcomers.jsp"; }else{ window.location.href = "index.jsp" + '?paramA=' + userName + "¶mB=" + password ; } } } }); }else{ window.location.href = "index.jsp" + '?paramA=' + userName + "¶mB=" + password; } }else if(result.status == "gateWayError"){ $(".login_all").show();//显示登录框 $(".dlts").html("证书未认证通过,请确定此证书的有效性") ; } else{ $(".login_all").show();//显示登录框 $(".dlts").html("证书与用户不匹配") ; } } }); refreshCode(); } } else { if(result.loginType != undefined && result.loginType == "reg"){ //注册中的用户 if (result.hasOwnProperty("renewableType")&&result.renewableType=="ok"){ window.location.href = "/RenewableEnergySubject/index/renewableParticipant.jsp?show=show"; }else if(result.hasOwnProperty("IS_OLDORNEW") && result.IS_OLDORNEW == 0){ window.location.href = "regIndex.jsp?pmosA=" + userName + "&pmosB=" + password+"&marketid="+para_val; }else{ var url =""; if(result.hasOwnProperty("IS_SELLER_REGIST_TOP") && result.IS_SELLER_REGIST_TOP==1){ url = result.REGIST_DIRECT_URL } window.location.href = "regIndexzb.jsp?urlzb="+url+"&pmosA=" + userName + "&pmosB=" + password+"&marketid="+para_val; } }else{ $.ajax({ url : '../UserSkinServlet?flag=99', type : 'post', dataType : 'text', success : function() { if(news=="1"){//新手上路 $.ajax({ url : '../../pmos/rest/common/getInitInfo', type : 'get', success : function(rc) { if (rc.successful) { participanttype = rc.resultValue.participanttype; if (participanttype != "1") { window.location.href = "newcomers.jsp"; }else{ window.location.href = "index.jsp" + '?paramA=' + userName + "¶mB=" + password ; } } } }); }else{ window.location.href = "index.jsp" + '?paramA=' + userName + "¶mB=" + password; } } }); } } }else{//如果未确认,则退出,要不然session会有值 $.ajax({ url : '../logOutServlet', type : 'post', data : "time=" + new Date().getTime() , dataType : 'text', success : function() { //退出成功 } }); } } }) } } } }); }else{//已确认承诺书 //然后验证用户名和KEY是否绑定 if(result.isUseKey == "YES") { //需要证书验证 // if(false) { //KEY插件 var eDiv = document.createElement("div"); //eDiv.style.display = "none"; if (navigator.appName.indexOf("Internet") >= 0) { if (window.navigator.cpuClass == "x86") { eDiv.innerHTML = ""; } else { eDiv.innerHTML = ""; } } else { eDiv.innerHTML = ""; $("#a_loadexe_id").css("display",""); $("#a_loadexe_id").attr("href","./plugs/npCryptoKit.Standard.x86.exe") ; } document.body.appendChild(eDiv); var CryptoAgency = document.getElementById("CryptoAgent"); var CertSubjectDN ; try { //CertSubjectDN = CryptoAgency.SelectSignCertificate("", "CFCA") ; CertSubjectDN = CryptoAgency.SelectSignCertificate("", "") ; } catch(err) {} if(!CertSubjectDN) //如果证书不存在 { var LastErrorDesc ; try { LastErrorDesc = CryptoAgency.GetLastErrorDesc(); } catch(e){} if(LastErrorDesc) { $(".dlts").html(LastErrorDesc); } else { $(".dlts").html("请先安装插件,然后插入证书使用") ; } $("#lb").removeClass("login_over"); refreshCode(); return false; } else { var selectedAlg = "sha-1"; var Signature = CryptoAgency.SignMessage(userName, selectedAlg); //加密 //因签名后的字符串中含有"+",提交到后台后如果不处理会变成" ",所以用",,,"替换"+",后台再用"+"替换",,," var sendData = 'username=' + userName + "&signUserName=" + Signature.replace(/\+/g,",,,") ; $.ajax({ url : '../loginCfcaServlet', data : sendData, dataType : 'json', type : 'post', success : function(result) { if(result.status == "true"){ if(news=="1"){//新手上路 $.ajax({ url : '../../pmos/rest/common/getInitInfo', type : 'get', success : function(rc) { if (rc.successful) { participanttype = rc.resultValue.participanttype; if (participanttype != "1") { window.location.href = "newcomers.jsp"; }else{ window.location.href = "index.jsp" + '?paramA=' + userName + "¶mB=" + password ; } } } }); }else{ window.location.href = "index.jsp" + '?paramA=' + userName + "¶mB=" + password; } }else if(result.status == "gateWayError"){ $(".dlts").html("证书未认证通过,请确定此证书的有效性") ; } else{ $(".dlts").html("证书与用户不匹配") ; } } }); refreshCode(); } } else { if(result.loginType != undefined && result.loginType == "reg"){ //注册中的用户 if(result.hasOwnProperty("IS_OLDORNEW") && result.IS_OLDORNEW == 0){ window.location.href = "regIndex.jsp?pmosA=" + userName + "&pmosB=" + password+"&marketid="+para_val; }else{ var url =""; if(result.hasOwnProperty("IS_SELLER_REGIST_TOP") && result.IS_SELLER_REGIST_TOP==1){ url = result.REGIST_DIRECT_URL } window.location.href = "regIndexzb.jsp?urlzb="+url+"&pmosA=" + userName + "&pmosB=" + password+"&marketid="+para_val; } }else{ $.ajax({ url : '../UserSkinServlet?flag=99', type : 'post', dataType : 'text', success : function() { if(news=="1"){//新手上路 $.ajax({ url : '../../pmos/rest/common/getInitInfo', type : 'get', success : function(rc) { if (rc.successful) { participanttype = rc.resultValue.participanttype; if (participanttype != "1") { window.location.href = "newcomers.jsp"; }else{ window.location.href = "index.jsp" + '?paramA=' + userName + "¶mB=" + password ; } } } }); }else{ window.location.href = "index.jsp" + '?paramA=' + userName + "¶mB=" + password; } } }); } } } } } }) }else { //如果本地登录失败,且登录人为售电公司,则尝试登录总部环境 if(result.hasOwnProperty("IS_SELLER_REGIST_TOP") && result.IS_SELLER_REGIST_TOP==1 && result.hasOwnProperty("currentMarket") && result.currentMarket !="91812"){ var url = result.REGIST_DIRECT_URL trylinkedzb(userName,password,url,pmosC); }else{//本地登录报错提示 if(result.loginNum==0) { $(".dlts").html("输入密码错误达到3次,用户已被锁定,请联系管理员解锁") ; $("#lb").removeClass("login_over"); }else if(result.loginNum==-1) { //判断是不是刚注册的用户 /*if(!showRegistInfo()){*/ $(".dlts").html("用户名不存在,请重试") ; $("#lb").removeClass("login_over"); /*}*/ }else if(result.loginNum==-2) { //判断是不是刚注册的用户 /*if(!showRegistInfo()){*/ $(".dlts").html("用户名或密码错误,请重试") ; $("#lb").removeClass("login_over"); // } }else if(result.hasOwnProperty('flag') && result.flag==-101) { //判断是不是刚注册的用户 /*if(!showRegistInfo()){*/ $(".dlts").html("注册地与当前平台不一致") ; $("#lb").removeClass("login_over"); // } }else { $(".dlts").html("用户名或密码不正确,您还有"+result.loginNum+"次输入机会") ; $("#lb").removeClass("login_over"); } } refreshCode(); } } }); }else{//除新疆外的其他省份 $.ajax({ url : '../loginServlet', data : 'userName=' + userName + "&password=" + password + "&verifyCode=" + verifyCode+"&pmosC="+pmosC, dataType : 'json', type : 'post', success : function(result) { //验证码校验 if(result.isverifyCode == "NO") { $(".dlts").html("验证码错误") ; refreshCode(); return; } //判断用户是否已被锁 if(result.isLock == "YES") { $(".dlts").html("用户已被锁定,请联系管理员解锁") ; $("#lb").removeClass("login_over"); refreshCode(); return; } if(result.status == "success") { var news = result.isnewcomers; //山西需求:登录验证用户是否确认阅读入市协议和平台使用协议 if(para_val == "92416"){//山西 //设置session值 $.ajax({ url : '../../pmos/rest/common/getInitInfo', type : 'get', async: false, success : function(rc) { if (rc.successful) { console.log("登录人市场成员id:"+rc.resultValue.participantid+ " 登录人类型 : "+rc.resultValue.participanttype); participantid = rc.resultValue.participantid; participanttype = rc.resultValue.participanttype; checkShanxiIfConfirm(); } }, error : function(event, request, settings) { console.log("getInitInfo 方法异常,设置session值方法失败!"); } }); } console.log("登录账号userName = "+userName+",是否需要确认协议标志:flag = "+checkResultFlag); if(checkResultFlag){//走正常流程 //然后验证用户名和KEY是否绑定 if(result.isUseKey == "YES") { //需要证书验证 // if(false) { //KEY插件 var eDiv = document.createElement("div"); //eDiv.style.display = "none"; if (navigator.appName.indexOf("Internet") >= 0) { if (window.navigator.cpuClass == "x86") { eDiv.innerHTML = ""; } else { eDiv.innerHTML = ""; } } else { eDiv.innerHTML = ""; $("#a_loadexe_id").css("display",""); $("#a_loadexe_id").attr("href","./plugs/npCryptoKit.Standard.x86.exe") ; } document.body.appendChild(eDiv); var CryptoAgency = document.getElementById("CryptoAgent"); var CertSubjectDN ; try { //CertSubjectDN = CryptoAgency.SelectSignCertificate("", "CFCA") ; CertSubjectDN = CryptoAgency.SelectSignCertificate("", "") ; } catch(err) {} if(!CertSubjectDN) //如果证书不存在 { var LastErrorDesc ; try { LastErrorDesc = CryptoAgency.GetLastErrorDesc(); } catch(e){} if(LastErrorDesc) { $(".dlts").html(LastErrorDesc); } else { $(".dlts").html("请先安装插件,然后插入证书使用") ; } $("#lb").removeClass("login_over"); refreshCode(); return false; } else { var selectedAlg = "sha-1"; var Signature = CryptoAgency.SignMessage(userName, selectedAlg); //加密 //因签名后的字符串中含有"+",提交到后台后如果不处理会变成" ",所以用",,,"替换"+",后台再用"+"替换",,," var sendData = 'username=' + userName + "&signUserName=" + Signature.replace(/\+/g,",,,") ; $.ajax({ url : '../loginCfcaServlet', data : sendData, dataType : 'json', type : 'post', success : function(result) { if(result.status == "true"){ if(news=="1"){//新手上路 $.ajax({ url : '../../pmos/rest/common/getInitInfo', type : 'get', success : function(rc) { if (rc.successful) { participanttype = rc.resultValue.participanttype; if (participanttype != "1") { window.location.href = "newcomers.jsp"; }else{ window.location.href = "index.jsp" + '?paramA=' + userName + "¶mB=" + password ; } } } }); }else{ window.location.href = "index.jsp" + '?paramA=' + userName + "¶mB=" + password; } }else if(result.status == "gateWayError"){ $(".dlts").html("证书未认证通过,请确定此证书的有效性") ; } else{ $(".dlts").html("证书与用户不匹配") ; } } }); refreshCode(); } } else { if(result.loginType != undefined && result.loginType == "reg"){ //注册中的用户 if(result.hasOwnProperty("IS_OLDORNEW") && result.IS_OLDORNEW == 0){ window.location.href = "regIndex.jsp?pmosA=" + userName + "&pmosB=" + password+"&marketid="+para_val; }else{ var url =""; if(result.hasOwnProperty("IS_SELLER_REGIST_TOP") && result.IS_SELLER_REGIST_TOP==1){ url = result.REGIST_DIRECT_URL } window.location.href = "regIndexzb.jsp?urlzb="+url+"&pmosA=" + userName + "&pmosB=" + password+"&marketid="+para_val; } }else{ $.ajax({ url : '../UserSkinServlet?flag=99', type : 'post', dataType : 'text', success : function() { if(news=="1"){//新手上路 $.ajax({ url : '../../pmos/rest/common/getInitInfo', type : 'get', success : function(rc) { if (rc.successful) { participanttype = rc.resultValue.participanttype; if (participanttype != "1") { window.location.href = "newcomers.jsp"; }else{ window.location.href = "index.jsp" + '?paramA=' + userName + "¶mB=" + password ; } } } }); }else{ window.location.href = "index.jsp" + '?paramA=' + userName + "¶mB=" + password; } } }); } } }else{//需要弹框确认协议 目前只有山西验证 //验证用户名和KEY是否绑定 if(result.isUseKey == "YES") { //需要证书验证 // if(false) { //KEY插件 var eDiv = document.createElement("div"); //eDiv.style.display = "none"; if (navigator.appName.indexOf("Internet") >= 0) { if (window.navigator.cpuClass == "x86") { eDiv.innerHTML = ""; } else { eDiv.innerHTML = ""; } } else { eDiv.innerHTML = ""; $("#a_loadexe_id").css("display",""); $("#a_loadexe_id").attr("href","./plugs/npCryptoKit.Standard.x86.exe") ; } document.body.appendChild(eDiv); var CryptoAgency = document.getElementById("CryptoAgent"); var CertSubjectDN ; try { //CertSubjectDN = CryptoAgency.SelectSignCertificate("", "CFCA") ; CertSubjectDN = CryptoAgency.SelectSignCertificate("", "") ; } catch(err) {} if(!CertSubjectDN) //如果证书不存在 { var LastErrorDesc ; try { LastErrorDesc = CryptoAgency.GetLastErrorDesc(); } catch(e){} if(LastErrorDesc) { $(".dlts").html(LastErrorDesc); } else { $(".dlts").html("请先安装插件,然后插入证书使用") ; } $("#lb").removeClass("login_over"); refreshCode(); return false; } else { var selectedAlg = "sha-1"; var Signature = CryptoAgency.SignMessage(userName, selectedAlg); //加密 //因签名后的字符串中含有"+",提交到后台后如果不处理会变成" ",所以用",,,"替换"+",后台再用"+"替换",,," var sendData = 'username=' + userName + "&signUserName=" + Signature.replace(/\+/g,",,,") ; $.ajax({ url : '../loginCfcaServlet', data : sendData, dataType : 'json', type : 'post', success : function(result) { if(result.status == "true"){ console.log("登录账号userName = "+userName+"登录成功且证书验证成功,现开始弹框确认协议 "); //登录成功且证书验证成功,然后弹框确认协议 $(".login_all").hide();//隐藏登录框 var url = "entryLetter.jsp" ; //全局弹出入市协议 top.$.jBox("iframe:"+url, { title: "山西电力交易平台入市协议", id:"1", width: 420, height: 230, //showClose: false,//不显示右上角关闭窗口× buttons:{"下一步":true}, submit:function(v,h,f){ if(v == true){ var a = top.$.jBox.getIframe('1').contentWindow.$("#tx")[0].checked; if(!a){ top.$.messager.alert('消息','请先阅读并同意入市协议!'); return false; }else{ url = "platformUsageLetter.jsp"; //全局弹出平台使用协议 top.$.jBox("iframe:"+url, { title: "山西电力交易平台使用协议", id:"2", width: 420, height: 230, //showClose: false,//不显示右上角关闭窗口× buttons:{"确认":true, "取消":false}, submit:function(v,h,f){ if(v == true){//确认 var a = top.$.jBox.getIframe('2').contentWindow.$("#tx")[0].checked; if(!a){ top.$.messager.alert('消息','请先阅读并同意平台使用协议!'); return false; } //验证成功,跳到登录成功页面 //往SX_AGREEMENTCONFIRMATION插入一条数据 $.ajax({ url : '../../pmos/rest/baMarketparticipantInfo/saveConfirmInfo?loginId='+$("#loginname").val()+"&participantid="+participantid+"&participanttype="+participanttype, type : 'post', async: true, success : function(rc) { if(rc) { //保存成功 if(news=="1"){//新手上路 $.ajax({ url : '../../pmos/rest/common/getInitInfo', type : 'get', success : function(rc) { if (rc.successful) { participanttype = rc.resultValue.participanttype; if (participanttype != "1") { window.location.href = "newcomers.jsp"; }else{ window.location.href = "index.jsp" + '?paramA=' + userName + "¶mB=" + password ; } } } }); }else{ window.location.href = "index.jsp" + '?paramA=' + userName + "¶mB=" + password; } }else{ //top.$.messager.alert('提示','两个协议在线确认保存失败!'); return false; } } }); }else{//取消 跳回登录页面 logout(); } } }); } } } }); }else if(result.status == "gateWayError"){ $(".dlts").html("证书未认证通过,请确定此证书的有效性") ; } else{ $(".dlts").html("证书与用户不匹配") ; } } }); refreshCode(); } } else {//不需要证书验证 //登录成功,然后弹框确认协议 $(".login_all").hide();//隐藏登录框 var url = "entryLetter.jsp" ; //全局弹出入市协议 top.$.jBox("iframe:"+url, { title: "山西电力交易平台入市协议", id:"1", width: 420, height: 230, //showClose: false,//不显示右上角关闭窗口× buttons:{"下一步":true}, submit:function(v,h,f){ if(v == true){ var a = top.$.jBox.getIframe('1').contentWindow.$("#tx")[0].checked; if(!a){ top.$.messager.alert('消息','请先阅读并同意入市协议!'); return false; }else{ url = "platformUsageLetter.jsp"; //全局弹出平台使用协议 top.$.jBox("iframe:"+url, { title: "山西电力交易平台使用协议", id:"2", width: 420, height: 230, //showClose: false,//不显示右上角关闭窗口× buttons:{"确认":true, "取消":false}, submit:function(v,h,f){ if(v == true){//确认 var a = top.$.jBox.getIframe('2').contentWindow.$("#tx")[0].checked; if(!a){ top.$.messager.alert('消息','请先阅读并同意平台使用协议!'); return false; } //往SX_AGREEMENTCONFIRMATION插入一条数据 $.ajax({ url : '../../pmos/rest/baMarketparticipantInfo/saveConfirmInfo?loginId='+$("#loginname").val()+"&participantid="+participantid+"&participanttype="+participanttype, type : 'post', async: true, success : function(rc) { if(rc) { //保存成功 }else{ //top.$.messager.alert('提示','两个协议在线确认保存失败!'); return false; } } }); //验证成功,跳到登录成功页面 if(result.loginType != undefined && result.loginType == "reg"){ //注册中的用户 if(result.hasOwnProperty("IS_OLDORNEW") && result.IS_OLDORNEW == 0){ window.location.href = "regIndex.jsp?pmosA=" + userName + "&pmosB=" + password+"&marketid="+para_val; }else{ var url =""; if(result.hasOwnProperty("IS_SELLER_REGIST_TOP") && result.IS_SELLER_REGIST_TOP==1){ url = result.REGIST_DIRECT_URL } window.location.href = "regIndexzb.jsp?urlzb="+url+"&pmosA=" + userName + "&pmosB=" + password+"&marketid="+para_val; } }else{ $.ajax({ url : '../UserSkinServlet?flag=99', type : 'post', dataType : 'text', success : function() { if(news=="1"){//新手上路 $.ajax({ url : '../../pmos/rest/common/getInitInfo', type : 'get', success : function(rc) { if (rc.successful) { participanttype = rc.resultValue.participanttype; if (participanttype != "1") { window.location.href = "newcomers.jsp"; }else{ window.location.href = "index.jsp" + '?paramA=' + userName + "¶mB=" + password; } } } }); }else{ window.location.href = "index.jsp" + '?paramA=' + userName + "¶mB=" + password; } } }); } }else{//取消 跳回登录页面 logout(); } } }); } } } }); } } } else { //如果本地登录失败,且登录人为售电公司,则尝试登录总部环境 if(result.hasOwnProperty("IS_SELLER_REGIST_TOP") && result.IS_SELLER_REGIST_TOP==1){ var url = result.REGIST_DIRECT_URL loginzb(userName,password,url,pmosC); }else{//本地登录报错提示 if(result.loginNum==0) { $(".dlts").html("输入密码错误达到3次,用户已被锁定,请联系管理员解锁") ; $("#lb").removeClass("login_over"); }else if(result.loginNum==-1) { //判断是不是刚注册的用户 /*if(!showRegistInfo()){*/ $(".dlts").html("用户名不存在,请重试") ; $("#lb").removeClass("login_over"); /*}*/ }else if(result.loginNum==-2) { //判断是不是刚注册的用户 /*if(!showRegistInfo()){*/ $(".dlts").html("用户名或密码错误,请重试") ; $("#lb").removeClass("login_over"); // } }else if(result.hasOwnProperty('flag') && result.flag==-101) { //判断是不是刚注册的用户 /*if(!showRegistInfo()){*/ $(".dlts").html("注册地与当前平台不一致") ; $("#lb").removeClass("login_over"); // } }else { $(".dlts").html("用户名或密码不正确,您还有"+result.loginNum+"次输入机会") ; $("#lb").removeClass("login_over"); } } refreshCode(); } } }); } } function loginzb(username,password,url,pmosC) { $.ajax({ url : url+"/pmosIntegration/initServ", data : 'pmosA=' + username + "&pmosB=" + password+"&pmosC="+pmosC, dataType : 'json', type : 'post', success : function(result) { //判断用户是否已被锁 if(result.isLock == "YES") { $(".dlts").html("用户已被锁定,请联系管理员解锁") ; $("#lb").removeClass("login_over"); refreshCode(); return; } if(result.status == "success") { var news = result.isnewcomers; //然后验证用户名和KEY是否绑定 if(result.isUseKey == "YES") { //去掉证书验证 // if(false) { //KEY插件 var eDiv = document.createElement("div"); //eDiv.style.display = "none"; if (navigator.appName.indexOf("Internet") >= 0) { if (window.navigator.cpuClass == "x86") { eDiv.innerHTML = ""; } else { eDiv.innerHTML = ""; } } else { eDiv.innerHTML = ""; $("#a_loadexe_id").css("display",""); $("#a_loadexe_id").attr("href","./plugs/npCryptoKit.Standard.x86.exe") ; } document.body.appendChild(eDiv); var CryptoAgency = document.getElementById("CryptoAgent"); var CertSubjectDN ; try { //CertSubjectDN = CryptoAgency.SelectSignCertificate("", "CFCA") ; CertSubjectDN = CryptoAgency.SelectSignCertificate("", "") ; } catch(err) {} if(!CertSubjectDN) //如果证书不存在 { var LastErrorDesc ; try { LastErrorDesc = CryptoAgency.GetLastErrorDesc(); } catch(e){} if(LastErrorDesc) { $(".dlts").html(LastErrorDesc); } else { $(".dlts").html("请先安装插件,然后插入证书使用") ; } $("#lb").removeClass("login_over"); refreshCode(); return false; } else { var selectedAlg = "sha-1"; var Signature = CryptoAgency.SignMessage(userName, selectedAlg); //加密 //因签名后的字符串中含有"+",提交到后台后如果不处理会变成" ",所以用",,,"替换"+",后台再用"+"替换",,," var sendData = 'username=' + userName + "&signUserName=" + Signature.replace(/\+/g,",,,") ; $.ajax({ url : '../loginCfcaServlet', data : sendData, dataType : 'json', type : 'post', success : function(result) { if(result.status == "true"){ if(news=="1"){//新手上路 $.ajax({ url : '../../pmos/rest/common/getInitInfo', type : 'get', success : function(rc) { if (rc.successful) { participanttype = rc.resultValue.participanttype; if (participanttype != "1") { window.location.href = "newcomers.jsp"; }else{ window.location.href = "index.jsp"; } } } }); }else{ window.location.href = "index.jsp"; } }else if(result.status == "gateWayError"){ $(".dlts").html("证书未认证通过,请确定此证书的有效性") ; } else{ $(".dlts").html("证书与用户不匹配") ; } } }); refreshCode(); } } else { if(result.loginType != undefined && result.loginType == "reg"){ //注册中的用户 if(result.hasOwnProperty("IS_OLDORNEW") && result.IS_OLDORNEW == 0){ window.location.href = "regIndex.jsp?pmosA=" + username + "&pmosB=" + password+"&marketid="+para_val; }else{ window.location.href = "regIndexzb.jsp?urlzb="+url+"&pmosA=" + username + "&pmosB=" + password+"&marketid="+para_val; } }else{ $.ajax({ url : '../UserSkinServlet?flag=99', type : 'post', dataType : 'text', success : function() { if(news=="1"){//新手上路 $.ajax({ url : '../../pmos/rest/common/getInitInfo', type : 'get', success : function(rc) { if (rc.successful) { participanttype = rc.resultValue.participanttype; if (participanttype != "1") { window.location.href = "newcomers.jsp"; }else{ window.location.href = "index.jsp"; } } } }); }else{ window.location.href = "index.jsp"; } } }); } } } else { //如果本地登录失败,且登录人为售电公司,则尝试登录总部环境 if(result.hasOwnProperty('participanttype') && result.loginNum==6){ }else{ if(result.loginNum==0) { $(".dlts").html("输入密码错误达到3次,用户已被锁定,请联系管理员解锁") ; $("#lb").removeClass("login_over"); }else if(result.loginNum==-1) { //判断是不是刚注册的用户 /*if(!showRegistInfo()){*/ $(".dlts").html("用户名不存在,请重试") ; $("#lb").removeClass("login_over"); /*}*/ }else if(result.loginNum==-2) { //判断是不是刚注册的用户 /*if(!showRegistInfo()){*/ $(".dlts").html("用户名或密码错误,请重试") ; $("#lb").removeClass("login_over"); // } }else if(result.hasOwnProperty('flag') && result.flag==-100) { //判断是不是刚注册的用户 /*if(!showRegistInfo()){*/ $(".dlts").html("注册地与当前平台不一致") ; $("#lb").removeClass("login_over"); // } }else { $(".dlts").html("用户名或密码不正确,您还有"+result.loginNum+"次输入机会") ; $("#lb").removeClass("login_over"); } } refreshCode(); } } }); } function logout() { var yeson = window.confirm('是否退出系统',''); if(yeson){ $.ajax({ url : '../logOutServlet', type : 'post', data : "time=" + new Date().getTime() , dataType : 'text', success : function() { window.location.href="login.jsp"; } }); } } function enter() { window.location.href = '/index/index.html' ; } /** * 登陆页面所有more调用 */ function moreOnDown(data){ /*var title=data.title;*/ var itemid=data.id; if("218111"==itemid){ window.location="./infoList3.jsp?itemid="+itemid; }else if("211000"==itemid && para_val=="98812"){//新疆 注册公示修改为市场主体目录公示 跳转新页面 by-hjx 19-7-3 // window.location="./infoList3.jsp?itemid="+itemid; window.location="../../xjpmos/index/marketCatalogue.jsp?itemid="+itemid; }else{ window.location="./infoList.jsp?itemid="+itemid; } } function logNews(guid){//点击新闻时记录用户点击新闻数 $.ajax({ url : "../../ETradePublicUtils/rest/newslogcontroller/insertNewslogInfo?guid="+ guid, type : "get", data : {}, success : function(data) { } // error : function(event, request, settings) { // alert('操作失败!'); // } }); } /** * 上传帮助手册 */ function uploadBzsc() { var url = "../powerInfoPub/uploadBzsc.jsp"; top.$.jBox("iframe:"+url, { title: "上传帮助手册", width: 500, height: 220, modal:true, buttons:{} }); } function caUnlocked(){ var downLoadFrame = document.getElementById("downLoadFrame"); //电力用户信用承认书 downLoadFrame.src = "/pmos/rest/regist/downcommitment?participantType=1102"; } function zsapply(){ $.ajax({ url : "../rest/regist/checkCFCA_URL", type : "post", dataType : "json", data:"", async:false,//异步刷新 success : function(data) { if(data.successful){ if(data.resultValue.items[0].flag == "true" ){//&& "91812" != para_val var cfca_url = data.resultValue.items[0].url; var hrefE = document.createElement("a"); hrefE.href = cfca_url; hrefE.target = '_blank'; document.body.appendChild(hrefE); hrefE.click(); // window.open(cfca_url,"_blank"); }else{ if(para_val == '91812'){ var hrefE = document.createElement("a"); hrefE.href = '../cfca/cfcaindex.jsp'; hrefE.target = '_blank'; document.body.appendChild(hrefE); hrefE.click(); // window.open('../cfca/cfcaindex.jsp',"_blank"); }else{ var hrefE = document.createElement("a"); hrefE.href = 'https://pmos.sgcc.com.cn/pmos/cfca/cfcaindex.jsp'; hrefE.target = '_blank'; document.body.appendChild(hrefE); hrefE.click(); // window.open('https://pmos.sgcc.com.cn/pmos/cfca/cfcaindex.jsp',"_blank"); } } } }, error : function(event, request, settings) { top.$.messager.alert('消息','程序异常!'); } }); } /*function showRegistInfo(){ var userName = $("#loginname").val() ; var password = $("#loginpass").val() ; var flag=false; $.ajax({ url : '../../pmos/rest/regist/showRegistInfo', type : 'post', data : {"userName":userName,"password":password} , dataType : 'text', success : function(data) { if(data.participantid==""||data.participantid==null){ }else{ window.location.href="../participantInfo.jsp?participantid="+participantid; } } }); if(!flag){ return false; } }*/ /* * 山西需求:登录验证用户是否确认阅读入市协议和平台使用协议 */ function checkShanxiIfConfirm(){ $.ajax({ url : '../../pmos/rest/baMarketparticipantInfo/checkShanxiIfConfirm', type : 'get', async: false, success : function(rc) { if(rc) { if(rc.state == 0){//不存在数据 弹出入市协议弹框 checkResultFlag = false; }else{ checkResultFlag = true; } } } }) } /* * 退出登录页面 */ function logout(){ $.ajax({ url : '../logOutServlet', type : 'post', data : "time=" + new Date().getTime() , dataType : 'text', success : function() { window.location.href="login.jsp"; } }); } /* * 新疆新需求:查找承诺书 * 参数page:为了区分是注册还是登录 */ function getCommitmentContent(){ $.ajax({ url :"/pmos/rest/regist/getCommitmentContent", type : "get", async : false, dataType :"json", success : function(data){ var nextPage = ""; if(data && data.length > 0){ if(data[0].XH == "1"){//市场风险提示书 nextPage = "registLetterxj.jsp?page=1"; }else if(data[0].XH == "2"){//诚信承诺书 nextPage = "sincerityLetter.jsp?page=1"; }else if(data[0].XH == "3"){//可再生能源消纳承诺书 nextPage = "renewableEnergyLetter.jsp?page=1"; }else if(data[0].XH == "4"){//平台使用承诺书 nextPage = "platUseLetter.jsp?page=1"; }else if(data[0].XH == "5"){//注册承诺书 nextPage = "registKnowxj.jsp?page=1"; } }else{ nextPage = "selectParticipantType.jsp?page=1"; } $("#zhuce").attr('href', "../index/"+nextPage); } }); }