项目初始化

This commit is contained in:
禺狨
2023-06-25 11:25:39 +08:00
commit 87f82475aa
39 changed files with 893 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
import React from "react";
import { getToken } from "../../utils/index";
import { Navigate } from "react-router-dom";
interface PropInterface {
Component: any;
}
const PrivateRoute: React.FC<PropInterface> = ({ Component }) => {
return getToken() ? Component : <Navigate to="/login" replace={true} />;
};
export default PrivateRoute;