sinaSSOConfig = new function() { this.service = "active"; this.customLoginCallBack = function (loginStatus) { if (!loginStatus.result) { if(loginStatus['errno'] == 4049){ $("#codeDiv").show(); if($('#codeImg').html() == ""){ $('#codeImg').html(""); $("#changeCode").show(); } alert("请输入验证码"); return false; }else if(loginStatus['errno'] == 2070){ $('#codeImg').html(""); alert("登录失败:验证码输入错误"); return false; } if(!loginStatus.reason) loginStatus.reason = "登录名或密码错误"; alert("登录失败:"+loginStatus.reason); } else { var theurl=location.href; if(theurl.indexOf("index.php") != "-1" || theurl.indexOf(".php") == "-1") { //登录成功 window.location.href = '/'; } } }; this.customLogoutCallBack = function(logoutStatus) { //用户退出后的操作 window.location.href="login.html"; }; }; function PlayLoginLayer() { var UserInfo=new Array(); UserInfo["username"]=document.getElementById("username1").value; UserInfo["password"]=document.getElementById("password1").value; if(document.getElementById("code")){ sinaSSOController.loginExtraQuery['door'] = $("#code").val(); } UserInfo["keeplogin"]=$("#keeplogin").attr("checked") ? 1 : 0; var SaveTime=(UserInfo["keeplogin"]) ? 30*24*3600 : 0; sinaSSOController.login(UserInfo["username"],UserInfo["password"],SaveTime); } function changeCode(){ $('#codeImg').html(""); } function PlayLogout() { sinaSSOController.logout(); }