import { Feature } from 'oak-frontend-base/es/types/Feature'; import { OakException } from 'oak-domain/lib/types/Exception'; import { Cache } from 'oak-frontend-base/es/features/cache'; import { LocalStorage } from 'oak-frontend-base/es/features/localStorage'; import { Environment } from 'oak-frontend-base/es/features/environment'; import { Application } from './application'; import { EntityDict } from '../oak-app-domain'; export declare class Token extends Feature { protected tokenValue?: string; protected environment: Environment; protected cache: Cache; protected storage: LocalStorage; protected application: Application; protected ignoreExceptionList: typeof OakException[]; protected loadSavedToken(): Promise; constructor(cache: Cache, storage: LocalStorage, environment: Environment, application: Application); protected checkNeedSetPassword(): Promise | undefined; refreshTokenData(tokenValue?: string): Promise; loginByMobile(mobile: string, captcha?: string, disableRegister?: boolean): Promise; loginByEmail(email: string, captcha: string, disableRegister?: boolean): Promise; loginByAccount(account: string, password: string): Promise; bindByMobile(mobile: string, captcha?: string): Promise; bindByEmail(email: string, captcha?: string): Promise; loginWebByMpToken(mpToken: string): Promise; loginByWechatInWebEnv(wechatLoginId: string): Promise; loginByOAuth(code: string, state: string): Promise; loginWechat(code: string, params?: { wechatLoginId?: string; }): Promise; loginWechatMp(params?: { wechatLoginId?: string; }): Promise; loginWechatNative(code: string): Promise; syncUserInfoWechatMp(): Promise; logout(dontPublish?: boolean): Promise; removeToken(dontPublish?: boolean): void; getTokenValue(): string | undefined; getToken(allowUnloggedIn?: boolean): Partial | undefined; getUserId(allowUnloggedIn?: boolean): NonNullable | undefined; getUserInfo(): NonNullable | undefined; isRoot(): boolean; /** * 这个是指token的player到底是不是root * @returns */ isReallyRoot(): boolean; isSelf(): boolean; sendCaptcha(origin: 'email' | 'mobile', content: string, type: 'login' | 'changePassword' | 'confirm'): Promise; switchTo(userId: string): Promise; refreshWechatPublicUserInfo(): Promise; getWechatMpUserPhoneNumber(code: string): Promise; wakeupParasite(id: string): Promise; needVerifyPassword(): boolean | null | undefined; verifyPassword(password: string): Promise; /** * 添加一个异常到忽略列表,如果refreshToken时出现这个异常,不会强制用户登出 */ addIgnoreException(clazz: typeof OakException): void; removeIgnoreException(clazz: typeof OakException): void; }