当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript SessionStorageService.retrieve方法代码示例

本文整理汇总了TypeScript中ngx-Webstorage.SessionStorageService.retrieve方法的典型用法代码示例。如果您正苦于以下问题:TypeScript SessionStorageService.retrieve方法的具体用法?TypeScript SessionStorageService.retrieve怎么用?TypeScript SessionStorageService.retrieve使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ngx-Webstorage.SessionStorageService的用法示例。


在下文中一共展示了SessionStorageService.retrieve方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: getLimit

 getLimit()   //sends list of registration forms to panelist
 {
   console.log(this.sstorage.retrieve('username'));
   return this.http.get('assets/data/limit.json')
  // return this.http.get('panelist/'+this.userName)          //getting UserType
   .flatMap((data) =>data.json());
 }
开发者ID:urvi01,项目名称:SP-TBI-Website,代码行数:7,代码来源:user.service.ts

示例2: getUser

 public getUser(): User {
     if (typeof this._user === 'undefined' || this._user === null) {
         const userFromSessionStorage: User = this.sessionStorage.retrieve(
             'user'
         );
         if (
             typeof userFromSessionStorage === 'undefined' ||
             userFromSessionStorage === null
         ) {
             this.router.navigate(['logout']);
         } else {
             this._user = userFromSessionStorage;
             return this._user;
         }
     } else {
         // check if user is still valid
         if (moment(this._user.exp * 1000).isBefore(moment(Date.now()))) {
             this.router.navigate(['logout']).then(() => {
                 setTimeout(() => {});
             });
             return undefined;
         }
         return this._user;
     }
 }
开发者ID:RCata,项目名称:Work-Work,代码行数:25,代码来源:user.service.ts

示例3: constructor

 constructor(
     private _script: ScriptLoaderService,
     private sessionStorage: SessionStorageService,
     private principal: Principal,
     private publicService: PublicService) {
     this.ctx = publicService.getServiceCtx('sys_module')
     this.nodeId = sessionStorage.retrieve("tree_module_select_node_id"), this.nodeId = (this.nodeId) ? this.nodeId : 1
 }
开发者ID:MissHaiKuan,项目名称:albedo-boot,代码行数:8,代码来源:module.component.ts

示例4: requestIntercept

    requestIntercept(options?: RequestOptionsArgs): RequestOptionsArgs {
        if (!options || !options.url || (/^http/.test(options.url) && !(SERVER_API_URL && options.url.startsWith(SERVER_API_URL)))) {
            return options;
        }

        const token = this.localStorage.retrieve('authenticationToken') || this.sessionStorage.retrieve('authenticationToken');
        if (!!token) {
            options.headers.append('Authorization', 'Bearer ' + token);
        }
        return options;
    }
开发者ID:lbuthman,项目名称:tasks-spring-angular,代码行数:11,代码来源:auth.interceptor.ts

示例5: intercept

    intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
        if (!request || !request.url || (/^http/.test(request.url) && !(SERVER_API_URL && request.url.startsWith(SERVER_API_URL)))) {
            return next.handle(request);
        }

        const token = this.localStorage.retrieve('authenticationToken') || this.sessionStorage.retrieve('authenticationToken');
        if (!!token) {
            request = request.clone({
                setHeaders: {
                    Authorization: 'Bearer ' + token
                }
            });
        }
        return next.handle(request);
    }
开发者ID:EugeneGoroschenya,项目名称:jhipster-sample-application,代码行数:15,代码来源:auth.interceptor.ts

示例6: getToken

 getToken() {
     return this.$localStorage.retrieve('authenticationToken') || this.$sessionStorage.retrieve('authenticationToken');
 }
开发者ID:Doha2012,项目名称:tutorials,代码行数:3,代码来源:auth-jwt.service.ts

示例7: getPreviousState

 getPreviousState() {
   return this.$sessionStorage.retrieve('previousState');
 }
开发者ID:jbbfreitas,项目名称:BestMeal,代码行数:3,代码来源:state-storage.service.ts

示例8: getUrl

 getUrl() {
   return this.$sessionStorage.retrieve('previousUrl');
 }
开发者ID:jbbfreitas,项目名称:BestMeal,代码行数:3,代码来源:state-storage.service.ts

示例9: getDestinationState

 getDestinationState() {
   return this.$sessionStorage.retrieve('destinationState');
 }
开发者ID:jbbfreitas,项目名称:BestMeal,代码行数:3,代码来源:state-storage.service.ts


注:本文中的ngx-Webstorage.SessionStorageService.retrieve方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。