Home.js 740 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
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>
    );
  }
}