Commit 31ce1418 by weiw

fix:处理登录

parent 7519c700
...@@ -155,16 +155,10 @@ export const Home: React.FC = () => { ...@@ -155,16 +155,10 @@ export const Home: React.FC = () => {
} }
}, [setToken]) }, [setToken])
useEffect(() => { // 修改 useEffect
if (!token) { useEffect(() => {
login() login()
} }, []) // 依赖数组为空,只在组件挂载时执行一次
else {
getQuestionList()
initConversation()
dispatch(fetchConversations())
}
}, [token])
return ( return (
<div className={styles.homePage}> <div className={styles.homePage}>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment