Sfoglia il codice sorgente

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

louhangfei 11 mesi fa
parent
commit
cc4254ccbe
1 ha cambiato i file con 3 aggiunte e 2 eliminazioni
  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>