Jelajahi Sumber

fix: 退出登录后重刷当前页面清除路由信息

louhangfei 11 bulan lalu
induk
melakukan
cc4254ccbe
1 mengubah file dengan 3 tambahan dan 2 penghapusan
  1. 3 2
      src/components/UserInfo.vue

+ 3 - 2
src/components/UserInfo.vue

@@ -23,9 +23,10 @@
   const userStore = useUserStore();
   const emit = defineEmits(['switchAccount', 'modifyPassword']);
 
-  const handleLogout = () => {
+  const handleLogout = async () => {
     userStore.logout();
-    router.push({ path: '/home' });
+    await router.push({ path: '/home' });
+    window.location.reload();
   };
 </script>