in ui/angular/src/app/login/login.component.ts [81:110]
login() {
var name = $("input:eq(0)").val();
var password = $("input:eq(1)").val();
var loginUrl = this.serviceService.config.uri.login;
this.loginBtnWait();
this.http.post(loginUrl, {username: name, password: password}).subscribe(
data => {
this.results = data;
if (this.results.status == 0) {
//logon success
if ($("input:eq(2)").prop("checked")) {
this.userService.setCookie("ntAccount", this.results.ntAccount, 30);
this.userService.setCookie("fullName", this.results.fullName, 30);
} else {
this.userService.setCookie("ntAccount", this.results.ntAccount, 0);
this.userService.setCookie("fullName", this.results.fullName, 0);
}
this.loginBtnActive();
window.location.replace("/");
} else {
this.showLoginFailed();
this.loginBtnActive();
}
},
err => {
this.showLoginFailed();
this.loginBtnActive();
}
);
}