Iam이 $ $ timeout에 문제가 있습니다. 괜찮아요. F5를 누르지 않으면 페이지가 다시로드됩니다. 페이지를 다시로드하면 타임 아웃이 중지되고 타임 아웃에서 제공 한 기능을 호출하지 않습니다. 코드가 좋지만 뭔가 빠져있는 것 같아. 페이지를 새로 고침 할 때 시간 초과가 발생하지 않는 이유는 무엇입니까?
export class AccountController
{
constructor(private $scope: ControllerScope, private $location: ng.ILocationService, private AuthService: AuthService, private $timeout: ng.ITimeoutService)
{
}
public Login(model: LoginModel)
{
this.AuthService.login(model).then((response: any) =>
{
//when token will expire -> logout
this.$timeout(() =>
{
this.Logout();
}, <number>response.TokenExpireTime).then((d) =>
{
alert('Czas trwania sesji wygasł');
});
this.$location.path('/');
},
(err) =>
{
alert(err.error_description);
});
}
public Logout()
{
this.AuthService.logOut();
this.$location.path("/login");
}
}
사용중인 구문에 익숙하지 않습니다.이 컴파일 된 자바 스크립트는 어떻게 든 사용하고 있습니까? – SoluableNonagon
TypeScript처럼 보입니다. –