clll
2023-09-05 6f4173009ac5c2d0cf03ccc02d1c37f046fd5b64
CanadaMes-ui/src/router/index.js
@@ -49,12 +49,21 @@
      },
      {
        path: '/device/talk',
        component: () => import('../views/device/talkvue'),
      },
      {
        path: '/device/alarm',
        component: () => import('../views/device/alarm')
      },
      {
        path: '/device/iostate',
        component: () => import('../views/device/iostate')
      },
      {
        path: '/device/talkvue',
        component: () => import('../views/device/talkvue')
      },
      {
        path: '/device/control',
@@ -76,6 +85,10 @@
        path: '/Electrical/State',
        component: () => import('../views/Electrical/State')
      },
      {
        path: '/Electrical/alarm',
        component: () => import('../views/Electrical/alarm')
      },
@@ -96,6 +109,18 @@
  // 获取token
  const hasToken = getToken();
  const isExist = Vue.prototype.$tagList.some(tag => tag.path === to.fullPath);
  if (!isExist) {
    Vue.prototype.$tagList.push({
      path: to.fullPath,
      data: null
    });
  }
  // 没有token则跳转到登录页面
  if (!hasToken) return next('/login');