本文整理汇总了TypeScript中app/main.angularApp.logService类的典型用法代码示例。如果您正苦于以下问题:TypeScript angularApp.logService类的具体用法?TypeScript angularApp.logService怎么用?TypeScript angularApp.logService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了angularApp.logService类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
});
}
开发者ID:dgzornoza,项目名称:angular-typescript-seed,代码行数:51,代码来源:authentication.service.ts
示例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;
})
开发者ID:dgzornoza,项目名称:angular-typescript-seed,代码行数:19,代码来源:authentication.service.ts
示例3:
.catch((reason: any) => {
angularApp.logService.error(`Error - ${url}: ${angular.toJson(reason)}`);
return this._q.reject(reason);
});
开发者ID:dgzornoza,项目名称:angular-typescript-seed,代码行数:4,代码来源:baseHttp.ts
示例4: logOut
public logOut(): void {
this._localStorageService.remove(LOCAL_STORAGE_AUTH_KEY);
this._rootScope.$emit(EVT_LOGOUT);
angularApp.logService.debug("authentication.service - logOut");
}
开发者ID:dgzornoza,项目名称:angular-typescript-seed,代码行数:6,代码来源:authentication.service.ts
示例5:
.catch((reason: any) => {
angularApp.logService.error("Error: auth.service - login: " + angular.toJson(reason.data));
this.logOut();
return this._q.reject(reason);
});
开发者ID:dgzornoza,项目名称:angular-typescript-seed,代码行数:5,代码来源:authentication.service.ts
注:本文中的app/main.angularApp.logService类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论