[web-app,monitor] 提供后台接口保护,打通前端认证登陆
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
const Authorization = 'Authorization';
|
||||
const refreshToken = 'refresh-token';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -22,6 +23,14 @@ export class LocalStorageService {
|
||||
return this.getData(Authorization);
|
||||
}
|
||||
|
||||
public getRefreshToken(): string | null {
|
||||
return this.getData(refreshToken);
|
||||
}
|
||||
|
||||
public storageRefreshToken(token: string) {
|
||||
return this.putData(refreshToken, token);
|
||||
}
|
||||
|
||||
public storageAuthorizationToken(token: string) {
|
||||
return this.putData(Authorization, token);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user