import React from 'react';
import { Redirect } from 'umi';
import { message } from 'antd';
// 权限校验
export default (props: any) => {
  if (localStorage.getItem('token')) {
    return <div>{props.children}</div>;
  } else {
    // 提示后跳转
    message.error('请先登录');
    return <Redirect to="/login" />;
  }
};
