21 lines
471 B
TypeScript
21 lines
471 B
TypeScript
|
import { useState } from "react";
|
||
|
|
||
|
import LoginPage from "./LoginPage";
|
||
|
import { useNavigate } from "react-router-dom";
|
||
|
|
||
|
function App(): JSX.Element {
|
||
|
const navigate = useNavigate();
|
||
|
const [authority, setAuthority] = useState(0);
|
||
|
if (authority === 1) {
|
||
|
navigate("/admin");
|
||
|
} else if (authority === 2) {
|
||
|
navigate("/pm");
|
||
|
} else if (authority === 3) {
|
||
|
navigate("/user");
|
||
|
}
|
||
|
|
||
|
return <LoginPage setAuthority={setAuthority} />;
|
||
|
}
|
||
|
|
||
|
export default App;
|