吉安感知网项目-前端
罗广辉
2026-02-04 0c92fd00fae033a2aa04bb65b2d32bd2c8f9fd4a
applications/drone-command/src/store/modules/user.js
@@ -8,6 +8,7 @@
import { setStore, getStore } from '@/utils/store';
import { validatenull } from '@/utils/validate';
import { deepClone } from '@/utils/util';
import defaultAva from '@/assets/images/defaultava.png'
import {
  loginByUsername,
  loginBySocial,
@@ -271,11 +272,10 @@
    GetMenu({ commit, dispatch }, tenantId) {
      const errLogOut = () => {
        dispatch('LogOut').then(()=>{
          const env = import.meta.env.VITE_APP_ENV
          const adminUrl = import.meta.env.VITE_APP_DASHBOARD_URL
          env === 'development'
            ? window.location.href = "/drone-command/login"
            : window.location.replace(`${adminUrl}#/login`)
               window.location.href = "/drone-command/login"
          // env === 'development'
          //   ? window.location.href = "/drone-command/login"
          //   : window.location.replace(`${adminUrl}#/login`)
        })
      }
      return new Promise(resolve => {
@@ -335,6 +335,9 @@
      if (validatenull(userInfo.user_id) && validatenull(userInfo.account)) {
        state.userInfo = { user_name: 'unauth', role_name: 'unauth' };
      } else {
        if (validatenull(userInfo.avatar)) {
          userInfo.avatar = defaultAva;
        }
        state.userInfo = userInfo;
      }
      setStore({ name: 'userInfo', content: state.userInfo });