Преглед на файлове

refactor: move cleanup to finally block

eric преди 5 месеца
родител
ревизия
694396dcfb
променени са 1 файла, в които са добавени 3 реда и са изтрити 3 реда
  1. 3 3
      playground/src/store/auth.ts

+ 3 - 3
playground/src/store/auth.ts

@@ -86,13 +86,13 @@ export const useAuthStore = defineStore('auth', () => {
 
     try {
       await logoutApi();
-
-      resetAllStores();
-      accessStore.setLoginExpired(false);
     } catch {
       // 不做任何处理
     } finally {
       isLoggingOut.value = false; // 重置 标识
+
+      resetAllStores();
+      accessStore.setLoginExpired(false);
     }
 
     // 回登录页带上当前路由地址