吉安感知网项目-前端
shuishen
2026-03-16 c1e0c945ec7c6d14873faa707cdde41f0599ee98
applications/task-work-order/src/utils/util.js
@@ -500,3 +500,21 @@
  document.body.removeChild(a)
  a = null
}
// 统一退出登录
export async function logOutFun() {
   // 延迟导入 store 和 router,避免循环依赖:
   // auth.js → router → store → user.js → auth.js
   const { default: store } = await import('@/store')
   const { default: router } = await import('@/router')
   const { VITE_APP_PARENT_SYSTEM, VITE_APP_ENV } = import.meta.env
   store.dispatch('LogOut').then(() => {
      const isDev = VITE_APP_ENV === 'development'
      if (isDev) {
         router.push({ path: '/login' })
         setTimeout(() => location.reload())
      } else {
         window.location.replace(`${VITE_APP_PARENT_SYSTEM}/#/login`)
      }
   })
}