管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2022-12-03 693c63dd4ea80db16f97c569df851a0f6fcf7906
src/components/navMenu.vue
@@ -64,7 +64,7 @@
import { logout, selectMenuRecursive } from '@/api/api';
import { removeToken, getToken } from '@/utils/auth';
import customElMenu from '../components/customElMenu.vue';
import { queryMenuTree } from '../api/api';
import { queryMenuTree, getPerms } from '../api/api';
import colorChange from '../views/maintenance/colorChange.vue';
import { containsCoordinate } from 'ol/extent';
import Vue from 'vue';
@@ -126,6 +126,30 @@
  },
  computed: {},
  methods: {
    async getCookies() {
      var boolean = this.getTimeCookies();
      if (boolean != true) {
        this.$router.push('/login');
        return;
      }
      if (this.$store.state.permsEntity.length == 0) {
        const data = await getPerms();
        this.$store.state.permsEntity = data.result;
      }
      this.$store.state.uname = JSON.parse(
        localStorage.getItem('LFToken')
      ).uname;
      this.$router.push('/');
    },
    getTimeCookies() {
      var time1 = new Date(JSON.parse(localStorage.getItem('LFToken')).time);
      var time2 = new Date();
      if (time2 > time1) {
        return false;
      } else {
        return true;
      }
    },
    //主题切换
    setThemeColors() {},
    //鼠标移入菜单事件
@@ -152,6 +176,7 @@
      this.changeSelectStyle = index;
    },
    setShowFalseDiv(bolean) {
      var index = this.showFlag;
      let newItem = this.listMenu[index];
@@ -165,6 +190,7 @@
      this.$store.commit('currentPerms', res.perms);
    },
    async getMenuTree() {
      this.getCookies();
      const data = await queryMenuTree();
      var that = this;
      if (data.code == 200) {
@@ -508,7 +534,7 @@
  }
  .secondMenuDiv {
    position: absolute;
    z-index: 30;
    z-index: 1024;
    margin-top: 10px;
    border: 1px solid white;
    border-radius: 5px;