$("#btnlogin").click(function () { var a = $("#btnlogin").html(); $("#btnlogin").attr("disabled", "true"); $("#btnlogin").text("登录中..."); $("#loginForm").ajaxSubmit({ url: "/APP/login/login", type: "post", success: function (b) { if (b.Status == 200) { save_cookies(); $.toastr.success("登录成功", { position: "top-center", time: 350, callback: function () { location.href ="/APP/Home/Index"}});$("#btnlogin").text(a);$("#btnlogin").removeAttr("disabled")}else{$.toastr.error("登录失败!
"+b.Message,{time:3000,position:"top-center"});$("#btnlogin").text(a);$("#btnlogin").removeAttr("disabled")}},error:function(b){$("#btnlogin").removeAttr("disabled");alert(b)}})});function save_cookies(){if($("#remember").prop("checked")){var b=$("#username").val();var a=$("#password").val();$.cookie("remember","true",{expires:7});$.cookie("username",b,{expires:7});$.cookie("password",a,{expires:7})}else{$.cookie("remember","false",{expires:-1});$.cookie("username","",{expires:-1});$.cookie("password","",{expires:-1})}};