本文整理汇总了TypeScript中app/main.angularApp.logService.debug方法的典型用法代码示例。如果您正苦于以下问题:TypeScript angularApp.logService.debug方法的具体用法?TypeScript angularApp.logService.debug怎么用?TypeScript angularApp.logService.debug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app/main.angularApp.logService
的用法示例。
在下文中一共展示了angularApp.logService.debug方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: login
public login(loginData: ILoginModel): ng.IPromise<ILoginResponseModel> {
angularApp.logService.debug("authentication.service - login ...");
// eliminar datos de logon si ya se esta logueado
if (this.AuthenticationData) {
this.logOut();
}
let params: any = {
grant_type: "password",
password: loginData.password,
username: loginData.username
};
if (loginData.useRefreshTokens) {
params.client_id = APP_NAME;
}
return this._http({
data: $.param(params),
headers: { "Content-Type": "application/x-www-form-urlencoded" },
method: "POST",
url: API_BASE_URL + "token"
})
.then((resultCallback: ng.IHttpPromiseCallbackArg<any>): ILoginResponseModel => {
angularApp.logService.debug("authentication.service - login: " + angular.toJson(resultCallback.data));
let now: Date = new Date();
let loginResponse: ILoginResponseModel = {
lastRequestDateTime: now,
loginDateTime: now,
refreshToken: loginData.useRefreshTokens ? resultCallback.data.refresh_token : "",
token: resultCallback.data.access_token,
useRefreshTokens: loginData.useRefreshTokens ? true : false,
userName: loginData.username
};
this._localStorageService.set(LOCAL_STORAGE_AUTH_KEY, loginResponse);
this._rootScope.$emit(EVT_LOGIN);
return loginResponse;
})
.catch((reason: any) => {
angularApp.logService.error("Error: auth.service - login: " + angular.toJson(reason.data));
this.logOut();
return this._q.reject(reason);
});
}
示例2: Date
.then((resultCallback: ng.IHttpPromiseCallbackArg<any>): ILoginResponseModel => {
angularApp.logService.debug("authentication.service - login: " + angular.toJson(resultCallback.data));
let now: Date = new Date();
let loginResponse: ILoginResponseModel = {
lastRequestDateTime: now,
loginDateTime: now,
refreshToken: loginData.useRefreshTokens ? resultCallback.data.refresh_token : "",
token: resultCallback.data.access_token,
useRefreshTokens: loginData.useRefreshTokens ? true : false,
userName: loginData.username
};
this._localStorageService.set(LOCAL_STORAGE_AUTH_KEY, loginResponse);
this._rootScope.$emit(EVT_LOGIN);
return loginResponse;
})
示例3:
return httpFn.then((result: ng.IHttpPromiseCallbackArg<T>): T => {
angularApp.logService.debug(`OK: ${url}: ${angular.toJson(result.data)}`);
return result.data;
})
示例4: logOut
public logOut(): void {
this._localStorageService.remove(LOCAL_STORAGE_AUTH_KEY);
this._rootScope.$emit(EVT_LOGOUT);
angularApp.logService.debug("authentication.service - logOut");
}