Skip to content

Commit

Permalink
Merge pull request #29 from 37-James/master
Browse files Browse the repository at this point in the history
fix http request has two Bearer after refresh page
  • Loading branch information
huajian123 authored Feb 6, 2023
2 parents cc549e6 + 2081c13 commit 09dc52a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/core/startup/startup.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Injectable } from '@angular/core';

import { TokenKey } from '@config/constant';
import { TokenKey, TokenPre } from '@config/constant';
import { LoginInOutService } from '@core/services/common/login-in-out.service';
import { UserInfoService } from '@store/common-store/userInfo.service';

Expand All @@ -13,7 +13,7 @@ export class StartupService {
constructor(private userInfoService: UserInfoService, private loginInOutService: LoginInOutService, private windowSer: WindowService) {}

load(): Promise<void> {
const token = this.windowSer.getSessionStorage(TokenKey);
const token = this.windowSer.getSessionStorage(TokenKey)?.replace(TokenPre,'');
if (token) {
return this.loginInOutService.loginIn(token);
}
Expand Down

0 comments on commit 09dc52a

Please sign in to comment.