UNPKG

@antdp/authorized

Version:

通过判断是否进入主界面还是登录界面。

19 lines (18 loc) 524 B
import { IRoute } from '@umijs/max'; export interface AuthorizedProps { /** * 准入权限/权限判断 */ authority?: boolean; /** * 权限异常时重定向的页面路由 */ redirectPath?: string; children?: React.ReactNode; } export interface AuthorizedBtnProps { path?: string; children?: React.ReactNode; } export type AuthList = (string | Record<string, unknown>)[]; export type GetAuthorizedPageProps = (allRouters: IRoute[], pathname: string) => boolean | 403 | 404;