You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

32 lines
849 B

var Login = function () {
this.Startup = function () {
$('#login-button').on('click', this.OnLoginButtonClick.bind(this));
}
this.OnLoginButtonClick = function () {
$.ajax({
type: "POST",
dataType: "json",
data: this.GetLoginParmas(),
url: "/User/Login",
success: function (result) {
if (result === false)
alert("用户名或密码错误.");
else
window.location.href = '/Beijing/Index';
}.bind(this)
});
}
this.GetLoginParmas = function () {
return {
name: $("#login-name").val(),
password: $("#login-password").val()
}
}
};
$(document).ready(function () {
var login = new Login();
login.Startup();
});