mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-17 09:34:31 +08:00
修改获取用户数据逻辑
This commit is contained in:
@@ -47,13 +47,18 @@ export default function (props: any) {
|
||||
});
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (!user) {
|
||||
getUser();
|
||||
}
|
||||
}, [props.location.pathname]);
|
||||
|
||||
useEffect(() => {
|
||||
const isAuth = localStorage.getItem(config.authKey);
|
||||
if (!isAuth) {
|
||||
history.push('/login');
|
||||
}
|
||||
vhCheck();
|
||||
getUser();
|
||||
|
||||
// patch custome layout title as react node [object, object]
|
||||
document.title = '控制面板';
|
||||
|
||||
Reference in New Issue
Block a user