wu
2023-09-05 933d18d5d5486743fd4ef0bae77c2ef24c39362a
CanadaMes-ui/src/router/index.js
@@ -49,6 +49,11 @@
      },
      {
        path: '/device/talk',
        component: () => import('../views/device/talkvue'),
      },
      {
        path: '/device/alarm',
        component: () => import('../views/device/alarm')
      },
@@ -96,6 +101,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');