<template>
  <div></div>
</template>

<script>
import { mapGetters } from "vuex";
export default {
  data() {
    return {};
  },
  computed: {
    ...mapGetters(["dept"]),
  },
  created() {
    if (this.$auth.hasRoleOr(["admin", "leader"])) {
      this.$router.replace({
        path: "/shequ",
      });
    } else if (this.$auth.hasRole("xiaoqu")) {
      if (this.dept.parentId == 238) {
        this.$router.replace({
          path: "/shequ",
          query: { deptId: this.dept.parentId },
        });
      } else {
        this.$router.replace({
          path: "/xiaoqu",
          query: { xiaoquId: this.dept.deptId },
        });
      }
    } else {
      this.$store.dispatch("LogOut").then(() => {
        this.$notify({
          title: "警告",
          message: "该账号暂无权限访问！",
          type: "warning",
        });
        this.$router.replace("/login");
      });
    }
  },
};
</script>

<style></style>
