提交 60c2cad6 authored 作者: sin's avatar sin

- 增加 Home 页面,默认重定向词页面

上级 de8e545e
......@@ -21,6 +21,15 @@ export default [
Routes: ['src/pages/Authorized'],
authority: ['admin', 'user'],
routes: [
// redirect
{ path: '/', redirect: '/home' },
// home
{
path: '/home',
name: 'home',
icon: 'user',
component: './Home/Home',
},
// admin
{
path: '/admin',
......@@ -34,8 +43,6 @@ export default [
},
],
},
// dashboard
{ path: '/', redirect: '/dashboard/analysis' },
{
path: '/dashboard',
name: 'dashboard',
......
import React, { Component } from 'react';
import { Button } from 'antd';
import AuthorityControl from '../../components/AuthorityControl';
import GlobalAuthority from '../../layouts/GlobalAuthorityContext';
export default class Home extends Component {
state = {};
render() {
// 定义认证的属性 TODO
const GlobalAuthorityProps = {
user: 'admin',
login: 'success',
authList: {
'auth.button': true,
},
};
return (
<GlobalAuthority.Provider value={GlobalAuthorityProps}>
<AuthorityControl authKey="home.button">
<Button type="primary">按钮 控制</Button>
</AuthorityControl>
<h1>home...</h1>
</GlobalAuthority.Provider>
);
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论