{"size": 827, "ext": "js", "max_stars_repo_path": "static/js/login.js", "max_stars_repo_name": "wzhsh90/go_firefly", "max_stars_repo_stars_event_min_datetime": "2021-01-29T10:16:00.000Z", "max_stars_repo_stars_event_max_datetime": "2021-01-29T17:32:58.000Z", "max_issues_repo_path": "static/js/login.js", "max_issues_repo_name": "wzhsh90/rust_firefly", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "static/js/login.js", "max_forks_repo_name": "wzhsh90/rust_firefly", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 21.7631578947, "max_line_length": 57, "alphanum_fraction": 0.4824667473}
layui.use(['form'], function () {
});
$(document).keyup(function (event) {
    var key = window.event ? event.keyCode : event.which;
    if (key == 13) {
        login();
    }
});

function login() {
    var account = $.trim($("#account").val());
    var password = $.trim($("#password").val());
    if (account == "") {
        layer.alert("用户名不能为空");
        return;
    }
    if (password == "") {
        layer.alert("密码不能为空");
        return;
    }
    var url = "/login_api";
    postAjax(url, {
        "account": account,
        "password": password
    }, function (result) {
        if (result["code"] == 0) {
            window.location.href = result["data"];
        } else {
            layer.alert(res["msg"]);
        }

    })
}

$(function () {
    $("#login-btn").click(login);
    regEnterQuery(login);
});