import { IAppMenu, IAppRouter } from '../types'; declare const AuthSymbol: unique symbol; declare class AuthHelper { /** * 是否禁止校验权限 */ static disabled: boolean; /** * 校验一组权限code是否全部有权限 * @param codes 权限code数组 * @returns 是否全部有权限 */ static appCodesVerify: (codes: string[]) => boolean; /** * 校验应用菜单权限 * @param appMenu: 传入的全量应用菜单 * @returns 返回有权限的菜单 * @example * const menus: IMenu[] = [ * { * index: '/PA/line', * label: 'PA广播', * [AuthSymbol]: 'PA', * icon: 'icon_yunwei', * }, * { * index: '/PA/time', * label: 'PA时间表', * [AuthSymbol]: 'PATime', * icon: 'icon_yunwei', * }, * { * index: '/PA/config', * label: 'PA配置', * [AuthSymbol]: 'PAConfig', * icon: 'icon_yunwei', * }, * ] * * const verifyMenus = AuthHelper.appMenuVerify(menus) */ static appMenuVerify: (appMenu: IAppMenu[]) => any; /** * 校验应用路由权限 * @param routerConfig 传入的路由配置 * @returns 返回校验的应用路由 * @example * const menuPageConfig: any = { * redirectRouter: '/PA', // 重定向的路由path * * pageRouter: [ * { * path: '/PA', * component: Layout, * redirect: '/PA/line', * name: 'PA', * children: [ * { * path: 'line', * component: () => import('../views/linePA/index.vue'), * name: 'line', * [AuthSymbol]: 'PA', * }, * { * path: 'time', * component: () => import('../views/linePATime/index.vue'), * name: 'time', * [AuthSymbol]: 'PATime', * }, * { * path: 'config', * component: () => import('../views/PAConfig/index.vue'), * name: 'config', * [AuthSymbol]: 'PAConfig', * }, * ], * }, * { * path: '/linePA', * component: () => import('../views/linePA/index.vue'), * name: 'linePA', * [AuthSymbol]: 'PA', * meta: { * hidden: true, * title: 'linePA', * noTagsView: true, * }, * }, * { * path: '/PAConfig', * component: () => import('../views/PAConfig/index.vue'), * name: 'PAConfig', * [AuthSymbol]: 'PAConfig', * meta: { * hidden: true, * title: 'PAConfig', * noTagsView: true, * }, * }, * ], * }; * * const verifyRouter = AuthHelper.appRouterVerify(menuPageConfig) */ static appRouterVerify: (routerConfig: IAppRouter) => any; } export { AuthSymbol, AuthHelper };