login.js 905 Bytes
var login = {};
var urls = {
    login: "/wanmei/login"
};


login.login = function() {
    var account = $("#account").val();
    var password = $("#password").val();
    console.log(_REQUESTURL + urls.login);
            if (account == m && password == p) {
                _putSessionId(account);
                setCookie(_SYSTEMKEY.SYSTEMUSER,account);
                var loginback = _getSession(_SYSTEMKEY.LOGINBACK);
                if(loginback){
                    // window.location.href = loginback;
                     window.location.href = "index.html";
                }else{
                     window.location.href = "index.html";
                }
                
                $("#alert_div").hide();
            } else {
                $("#alert_div").show();
            }

}


$(function() {

    $("#loginButton").on("click", function() {
        login.login();
    });
});