无人机管理后台前端(已迁走)
张含笑
2025-07-21 369043d09aa7922764818094886ef2b4e5e822af
src/store/modules/user.js
@@ -39,7 +39,7 @@
    token: getStore({ name: 'token' }) || '',
    refreshToken: getStore({ name: 'refreshToken' }) || '',
    parentDeptInfo: getStore({ name: 'parentDeptInfo' }) || '',
  },
  actions: {
    //根据用户名登录
@@ -273,12 +273,17 @@
        getRoutes(tenantId).then(res => {
          const data = res.data.data;
          let menu = deepClone(data);
          menu.forEach(ele => formatPath(ele, true));
          menu?.forEach(ele => formatPath(ele, true));
          commit('SET_MENU', menu);
          commit('SET_MENU_ALL', menu);
          dispatch('GetButtons');
          resolve(menu);
        });
        }).catch(err =>{
          dispatch('LogOut').then(()=>{
            const adminUrl = import.meta.env.VITE_APP_DASHBOARD_URL
            window.location.replace(`${adminUrl}#/login`)
          })
        })
      });
    },
    GetButtons({ commit }) {