Parcourir la source

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

louhangfei il y a 11 mois
Parent
commit
cc4254ccbe
1 fichiers modifiés avec 3 ajouts et 2 suppressions
  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>