import React from 'react';
import RenderAuthorized from '@/components/Authorized';
import Exception from '@/components/Exception';
import { getAuthority } from '@/utils/authority';
import { formatMessage } from 'umi/locale';
import Link from 'umi/link';
import Redirect from 'umi/redirect';
const Authority = getAuthority();
const Authorized = RenderAuthorized(Authority);
export default ({ children }) => {
let noMatch = (
);
// if Authority === ['guest'] redirect to /user/login
// You can implement the logic here.
if (Authority === 'guest' || Authority.join('') === 'guest') {
noMatch = ;
}
return (
{children}
);
};