Commit 77aaacb2 authored by 张烨's avatar 张烨

feat: 优化权限提示

parent 7b1ae5fd
import check from '@/components/Authorized/CheckPermissions';
import React from 'react';
import { renderRoutes } from 'react-router-config';
import page403 from '@/pages/exception/403';
const Layout = ({ children, route }) => (
<>
{children ||
renderRoutes(
route.routes.filter(
r => !r.authority || check(r.authority, true, false),
),
route.routes.map(r => {
if (!r.authority) {
return r;
}
r.component = check(r.authority, r.component, page403);
return r;
}),
)}
</>
);
......
......@@ -62,11 +62,13 @@ export default {
{
path: '/dbm/dbInit',
name: '数据库初始化',
authority: adminAuthority,
component: InitDataBase,
},
{
path: '/dbm/dbsm',
name: '数据库标准化管理',
authority: superAuthority,
component: ManagementDataBase,
},
],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment