* feat: add theme berry * docs: add development notes * fix: fix blank page * chore: update implementation * fix: fix package.json * chore: update ui copy --------- Co-authored-by: JustSong <songquanpeng@foxmail.com>
14 lines
261 B
JavaScript
14 lines
261 B
JavaScript
import { isAdmin } from 'utils/common';
|
|
import { useNavigate } from 'react-router-dom';
|
|
const navigate = useNavigate();
|
|
|
|
const useAuth = () => {
|
|
const userIsAdmin = isAdmin();
|
|
|
|
if (!userIsAdmin) {
|
|
navigate('/panel/404');
|
|
}
|
|
};
|
|
|
|
export default useAuth;
|