<template>
  <!-- <div class="container">
    <h1>首页 可作为大屏 也可以现在在左边栏中</h1>
    <el-button type="primary" @click="goSystem">进入系统</el-button>
  </div> -->
</template>

<script>
import { mapGetters } from "vuex";
export default {
  data() {
    return {};
  },
  methods: {
    goSystem() {
      this.$router.push({ path: "/system/user" }).catch(() => {});
    },
  },
  computed: {
    ...mapGetters(["sidebarRouters"]),
    ...mapGetters(["firstRouter"]),
  },
  mounted() {
    let menus = [];
    this.sidebarRouters.forEach((item) => {

      if (item.hidden !== true && item.redirect != "index") {
        if (item.path === "/") {
          menus.push(item.children[0]);
        } else {
          menus.push(item);
        }
      }
    });
    // console.log(this.firstRouter, "第一个路由");
    this.$router.push("/" + menus[0].path);
  },
};
</script>

<style lang="scss" scoped>
.container {
  border: 1px solid red;
  height: 100%;
}
</style>
