var secureKey var secureCode var authType function getSecureCode() { $.ajax({ url : newPlatformUrl + "/px-common-authority/oldPlatform/getSecureKey", dataType : "json", async : false, withCredentials : true, headers : { "Content-Type" : "application/x-www-form-urlencoded" }, type : "POST", success : function(res) { if (res.status == 0) { secureKey = res.data.secureKey secureCode = res.data.secureCode } } }) } function loginNewPlatform(name, pword, paramA, paramB) { getSecureCode() var sendData = {} sendData['loginName'] = name sendData['secureCode'] = secureCode sendData['authKey'] = SG_sm2Encrypt(pword, secureKey) sendData['loginFrom'] = 1 sendData['marketId'] = newMarketId $.ajax({ url : newPlatformUrl + "/px-common-authority/oldPlatform/oldLogin", dataType : "json", async : false, withCredentials : true, headers : { "Content-Type" : "application/json", }, data : JSON.stringify(sendData), type : "POST", success : function(res) { if (res.status == 0) { var result = res.data if (result.status == 0) { authType = result.data.authType if (authType == 0) { $(".dlts").html("请在新平台登录") $("#lb").removeClass("login_over") } else { if (newMarketId == result.data.marketId) { window.location.href = "regUserNew.jsp?paramA=" + paramA + "¶mB=" + paramB } else { $(".dlts").html("注册地与当前平台不一致") $("#lb").removeClass("login_over") } } } else { $(".dlts").html("用户名或密码错误,请重试") $("#lb").removeClass("login_over") } } else { $(".dlts").html("用户名或密码错误,请重试") $("#lb").removeClass("login_over") } } }) }