import { Privilege } from './Privilege'; import Authenticity from "./Authenticity"; export declare abstract class AuthenticationManager { protected token: string | null; protected authenticity: Authenticity | null; /** * TOKEN存储KEY */ static readonly TOKEN = "token"; /** * * @param token 登录认证token * @param authenticity 登录认证用户 */ constructor(token: string | null, authenticity: Authenticity | null); /** * 更新TOKEN */ updateToken(token: string): void; /** * 获取TOKEN */ getToken(): string; /** * 删除TOKEN */ removeToken(): void; /** * 删除登录信息 */ removeAuthentication(): void; /** * 退出 */ logout(): void; getAuthentication(): Authenticity | null; setAuthentication(authentication: Authenticity): void; /** * 更新登录认证 * @ param authentication */ updateAuthentication(authentication: Authenticity): void; /** * 判断是否登录 */ isLogin(): boolean; /** * 判断是否有权限 * @ param privilegeCode */ hasPrivilege(privilegeCode: string): boolean; recursivePrivilegeCode(privileges: Privilege[], privilegeCode: string): boolean; recursivePrivilegeValue(privileges: Privilege[], path: string): boolean; /** * 获取TOKEN */ getStorageToken(): string; deleteAuthentication(): void; getStorageAuthentication(): string; saveAuthentication(authentication: Authenticity): void; loadStorageAuthentication(): Promise; loadStorageToken(): Promise; hasRole(roleCode: any): boolean; }