[web-app] http拦截器修改,新增监控页面编码

This commit is contained in:
tomsun28
2021-11-30 22:16:38 +08:00
parent 619e407158
commit 090e6e8c16
37 changed files with 663 additions and 172 deletions

View File

@@ -0,0 +1,29 @@
import { Injectable } from '@angular/core';
const Authorization = 'Authorization';
@Injectable({
providedIn: 'root'
})
export class LocalStorageService {
constructor() { }
public putData(key: string, value: string) {
localStorage.setItem(key, value);
}
public getData(key: string): string | null {
const data = localStorage.getItem(key);
return data === null ? null : data;
}
public getAuthorizationToken(): string | null {
return this.getData(Authorization);
}
public storageAuthorizationToken(token: string) {
return this.putData(Authorization, token);
}
}