@antdp/authorized
Version:
通过判断是否进入主界面还是登录界面。
28 lines (23 loc) • 549 B
text/typescript
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;