[web-app,monitor] 提供后台接口保护,打通前端认证登陆

This commit is contained in:
tomsun28
2021-12-03 09:15:53 +08:00
parent 73d7c0cd5b
commit b632114ebd
10 changed files with 211 additions and 27 deletions

View File

@@ -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);
}