Authorized权限组件
首先是使用权限组件定义有权限组件的渲染方式,直接上代码:
import React from ‘react’;
/** 导出对象别名为 RenderAuthorized */
import RenderAuthorized from ‘@/components/Authorized’;
import { getAuthority } from ‘@/utils/authority’;
import Redirect from ‘umi/redirect’;
// 获取当前用户登录权限
const A ...