zengh
2021-09-17 049430b1619b44a21c0fae1c86c6e5bcb0b02f03
src/page/index/tags.vue
@@ -65,6 +65,35 @@
    },
    mounted() {
      this.setActive();
      this.tagList.forEach((item, index) => {
        if (item.label == "首页" && (this.userInfo.role_name == "policeAdmin" || this.userInfo.role_name == "administrator")){
          this.$store.commit("set_hideHome", false);
        }else if (item.label == "首页" && (this.userInfo.role_name == "操作员")) {
          this.tagList.splice(index, 1);
          this.$store.commit("set_hideHome", true);
          var d = this.$router.options.routes,
            path = "";
          for (var k in d) {
            if (d[k].peixun == true) {
              // console.log(d[k]);
              path = d[k].path;
            }
          }
          this.$router.push({ path: path });
        } else {
          this.tagList.splice(index, 1);
          this.$store.commit("set_hideHome", true);
          var d = this.$router.options.routes,
            path = "";
          for (var k in d) {
            if (d[k].kby == true) {
              // console.log(d[k]);
              path = d[k].path;
            }
          }
          this.$router.push({ path: path });
        }
      });
    },
    watch: {
      tag() {
@@ -75,7 +104,7 @@
      }
    },
    computed: {
      ...mapGetters(["tagWel", "tagList", "tag", "website"]),
      ...mapGetters(["tagWel", "tagList", "tag", "website", "userInfo"]),
      ...mapState({
        showTag: state => state.common.showTag
      }),