| | |
| | | return true; |
| | | } |
| | | |
| | | var isBusy = fase; |
| | | window.isBusy = false; |
| | | |
| | | function sysLogin() { |
| | | if (isBusy || !sysValidate()) { |
| | | return; |
| | | } |
| | | |
| | | isBusy = true; |
| | | var username = $.trim($("#username").val()); |
| | | var password = $("#password").val(); |
| | | var service = getQueryStr("service"); |
| | | |
| | | debugger |
| | | var data = { |
| | | "uid": username, |
| | | "pwd": password, |
| | | "bak": "http://www.baidu.com" |
| | | "pwd": password |
| | | }; |
| | | |
| | | $.ajax({ |
| | |
| | | dataType: "json", // html、json、jsonp、script、text |
| | | contentType: "application/json", // "application/json", "application/x-www-form-urlencoded", |
| | | success: function (rs) { |
| | | alert(rs); |
| | | isBusy = false; |
| | | if (rs && rs.code == 200) { |
| | | debugger |
| | | var service = getQueryStr("service"); |
| | | if (service) { |
| | | service += (service.indexOf("?") > -1 ? "&" : "?") + "token=" + rs.result.token; |
| | | location.href = service; |
| | | } |
| | | return; |
| | | } |
| | | |
| | | createCode(); |
| | | var msg = rs && rs.msg ? rs.msg : "登录失败!"; |
| | | $("#eMsg").html(msg); |
| | | }, |
| | | error: function (e) { |
| | | isBusy = false; |
| | | console.error(e); |
| | | alert("登录出错,请联系管理员!"); |
| | | } |