Commit 31ce1418 by weiw

fix:处理登录

parent 7519c700
......@@ -155,16 +155,10 @@ export const Home: React.FC = () => {
}
}, [setToken])
useEffect(() => {
if (!token) {
login()
}
else {
getQuestionList()
initConversation()
dispatch(fetchConversations())
}
}, [token])
// 修改 useEffect
useEffect(() => {
login()
}, []) // 依赖数组为空,只在组件挂载时执行一次
return (
<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