吉安感知网项目-前端
罗广辉
2026-03-11 77883fa16512cccc77923a33200dfb27fb22f526
feat: 退出登录
2 files modified
7 ■■■■■ changed files
applications/drone-command/src/permission.js 3 ●●●● patch | view | raw | blame | history
applications/drone-command/src/utils/util.js 4 ●●●● patch | view | raw | blame | history
applications/drone-command/src/permission.js
@@ -118,8 +118,7 @@
    if (meta.isAuth === false) {
      next()
    } else {
            next('/login')
            logOutFun()
            logOutFun(next)
    }
  }
})
applications/drone-command/src/utils/util.js
@@ -500,7 +500,7 @@
    a = null
}
// 统一退出登录
export function logOutFun() {
export function logOutFun(next) {
    // 延迟导入 store 和 router,避免循环依赖:
    // auth.js → router → store → user.js → auth.js
    const store = require('@/store').default
@@ -509,7 +509,7 @@
    store.dispatch('LogOut').then(() => {
        const isDev = VITE_APP_ENV === 'development'
        if (isDev) {
            router.push({ path: '/login' })
            next ? next() : router.push({ path: '/login' })
            setTimeout(() => location.reload())
        } else {
            window.location.replace(`${VITE_APP_PARENT_SYSTEM}/#/login`)