當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript ngx-Webstorage.SessionStorageService類代碼示例

本文整理匯總了TypeScript中ngx-Webstorage.SessionStorageService的典型用法代碼示例。如果您正苦於以下問題:TypeScript SessionStorageService類的具體用法?TypeScript SessionStorageService怎麽用?TypeScript SessionStorageService使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了SessionStorageService類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: 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

示例2: 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

示例3: storeAuthenticationToken

 storeAuthenticationToken(jwt, rememberMe) {
     if (rememberMe) {
         this.$localStorage.store('authenticationToken', jwt);
     } else {
         this.$sessionStorage.store('authenticationToken', jwt);
     }
 }
開發者ID:Doha2012,項目名稱:tutorials,代碼行數:7,代碼來源:auth-jwt.service.ts

示例4: 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

示例5: 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

示例6: storeDestinationState

 storeDestinationState(destinationState, destinationStateParams, fromState) {
   const destinationInfo = {
     destination: {
       name: destinationState.name,
       data: destinationState.data
     },
     params: destinationStateParams,
     from: {
       name: fromState.name
     }
   };
   this.$sessionStorage.store('destinationState', destinationInfo);
 }
開發者ID:jbbfreitas,項目名稱:BestMeal,代碼行數:13,代碼來源:state-storage.service.ts

示例7: storeDestinationState

 storeDestinationState(destinationState, destinationStateParams, fromState) {
     const destinationInfo = {
         'destination': {
             'name': destinationState.name,
             'data': destinationState.data,
         },
         'params': destinationStateParams,
         'from': {
             'name': fromState.name,
         }
     }
     this.$sessionStorage.store('destinationState', destinationInfo)
 }
開發者ID:MissHaiKuan,項目名稱:albedo-boot,代碼行數:13,代碼來源:state-storage.service.ts

示例8: 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

示例9: getPreviousState

 getPreviousState() {
   return this.$sessionStorage.retrieve('previousState');
 }
開發者ID:jbbfreitas,項目名稱:BestMeal,代碼行數:3,代碼來源:state-storage.service.ts

示例10: getUrl

 getUrl() {
   return this.$sessionStorage.retrieve('previousUrl');
 }
開發者ID:jbbfreitas,項目名稱:BestMeal,代碼行數:3,代碼來源:state-storage.service.ts


注:本文中的ngx-Webstorage.SessionStorageService類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。