未登录状态进入消息页面跳转首页

This commit is contained in:
谢思 2021-10-13 17:17:51 +08:00
parent 5c819070bb
commit 5d19f6c06b
1 changed files with 4 additions and 3 deletions

View File

@ -29,10 +29,11 @@ function MyNotice(props) {
//访/settings/profile
//访/explore
useEffect(()=>{
let notice_url = mygetHelmetapi && mygetHelmetapi.common && mygetHelmetapi.common.notice;
if(!current_user){
let notice = mygetHelmetapi && mygetHelmetapi.common && mygetHelmetapi.common.notice;
let login = current_user && current_user.login;
if(!login){
history.push(`/explore`);
}else if(!notice_url){
}else if(!notice){
history.push(`/settings/profile`);
}
},[mygetHelmetapi])