$('#login_form').submit(function () { |
| var user_name = $('.accountName').val(); |
| var user_password = $('.accountPwd').val(); |
| var check_code = $('.check_code').val(); |
| var check = $('body').hasClass('show_check'); |
| if (user_name == "请输入用户名" | user_name == "") { |
| $('#id_tips').show(); |
| $('.accountName').focus(); |
| return false; |
| } |
| if (user_password == "") { |
| $('#pwd_tips').show(); |
| $('.accountPwd').focus(); |
| return false; |
| } |
| if (check && check_code == "") { |
| $('#check_tips').show(); |
| $('.check_code').focus(); |
| return false; |
| } |
| |
| //$.dialog.tips(user_name+'--'+user_password+'---'+check_code) |
| //去后台验证 |
| jQuery.post("/eden.oa/logon/ajaxLogon.action", {"accountInfo.accountName":user_name, "accountInfo.accountPwd":user_password, "checkCode":check_code}, function (data) { |
| if (data["success"] == "true") { |
| c_user_name = getCookie("c_user_name"); |
| c_user_password = getCookie("c_user_password"); |
| setCookie("c_user_name", user_name); |
| setCookie("c_user_password", user_password); |
| window.location.href = "/eden.oa/admin/console/index.action"; |
| } else { |
| error_num++; |
| $.dialog.tips(data["error"]["errorMsg"],2); |
| $('#check_img').click(); |
| } |
| }); |
| |
| $('#check_tips').hide(); |
| |
| return false; |
| |
| }); |