ragflow/web/src/wrappers/auth.tsx

14 lines
298 B
TypeScript
Raw Normal View History

import { useAuth } from '@/hooks/authHook';
import { Navigate, Outlet } from 'umi';
2024-01-17 09:37:01 +08:00
export default () => {
const { isLogin } = useAuth();
if (isLogin === true) {
return <Outlet />;
} else if (isLogin === false) {
return <Navigate to="/login" />;
}
return <></>;
};