Home.js 987 Bytes
Newer Older
1 2 3
import React, { Component } from 'react';
import { Button } from 'antd';
import AuthorityControl from '../../components/AuthorityControl';
sin's avatar
sin committed
4
import UrlsContext from '../../layouts/UrlsContext';
5 6
import DictionaryValueSelect from '../Dictionary/DictionaryValueSelect';
import DictionaryValueText from '../Dictionary/DictionaryValueText';
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21

export default class Home extends Component {
  state = {};

  render() {
    // 定义认证的属性 TODO
    const GlobalAuthorityProps = {
      user: 'admin',
      login: 'success',
      authList: {
        'auth.button': true,
      },
    };

    return (
sin's avatar
sin committed
22
      <UrlsContext.Provider value={GlobalAuthorityProps}>
23 24 25 26
        <AuthorityControl authKey="home.button">
          <Button type="primary">按钮 控制</Button>
        </AuthorityControl>
        <h1>home...</h1>
27 28 29
        <DictionaryValueSelect dataKey="gender" defaultValue={1} />

        <DictionaryValueText dataKey="gender" value="1" />
sin's avatar
sin committed
30
      </UrlsContext.Provider>
31 32 33
    );
  }
}