吉安感知网项目-前端
罗广辉
2026-04-13 36facaced1c2378431cef222daa8c09206f77cff
applications/drone-command/src/store/modules/user.js
@@ -8,7 +8,7 @@
} from '@/utils/auth'
import { setStore, getStore } from '@/utils/store'
import { validatenull } from '@/utils/validate'
import { deepClone } from '@/utils/util'
import { deepClone, logOutFun } from '@/utils/util'
import defaultAva from '@/assets/images/defaultava.png'
import {
  loginByUsername,
@@ -259,21 +259,13 @@
      })
    },
    GetMenu ({ commit, dispatch }, tenantId) {
      const errLogOut = () => {
        dispatch('LogOut').then(() => {
          window.location.href = "/drone-command/login"
          // env === 'development'
          //   ? window.location.href = "/drone-command/login"
          //   : window.location.replace(`${adminUrl}#/login`)
        })
      }
      return new Promise(resolve => {
        getRoutes({tenantId,sysType}).then(res => {
          const data = res.data.data;
          let menu = deepClone(data);
          if (!res.data?.data?.length){
                  ElMessage.warning('当前角色没有配置菜单,请联系管理员配置')
            errLogOut()
                  setTimeout(logOutFun,1500)
            return
          }
          menu.forEach(ele => formatPath(ele, true))
@@ -282,7 +274,7 @@
          dispatch('GetButtons')
          resolve(menu)
        }).catch(err => {
          errLogOut()
               logOutFun()
        })
      })
    },