login.js 520 Bytes
if (typeof(dmap) == "undefined") var dmap = {};
dmap.login = {
    init: function() {
        $('#btn-login').bind('click', function(e) {
            let username = $("#username").val();
            let password = $("#password").val();

            if (username.length <= 0 || password.length <= 0) {
                tips.notify("用户名或密码不能为空", "danger", 1e3);
                return false;
            }

            $.post("authorize", { username: username, password: password })
        });
    }
};