fix(profile): 使用路由替换直接跳转首页
修复登出后直接修改 window.location 导致的页面刷新问题,改为使用路由跳转首页
Showing
1 changed file
with
3 additions
and
1 deletions
| ... | @@ -173,7 +173,9 @@ const handleCheckInData = (data) => { | ... | @@ -173,7 +173,9 @@ const handleCheckInData = (data) => { |
| 173 | const { logout } = useAuth(); | 173 | const { logout } = useAuth(); |
| 174 | const handleLogout = () => { | 174 | const handleLogout = () => { |
| 175 | logout(); | 175 | logout(); |
| 176 | - window.location.href = import.meta.env.VITE_BASE || '/'; | 176 | + // window.location.href = import.meta.env.VITE_BASE || '/'; |
| 177 | + // 返回首页 | ||
| 178 | + router.replace({ path: '/' }); | ||
| 177 | }; | 179 | }; |
| 178 | 180 | ||
| 179 | // Handle menu item click | 181 | // Handle menu item click | ... | ... |
-
Please register or login to post a comment