zhangzengfei
2021-09-07 1cb263efda55e67a8d5066edd7709b056f9b85ff
src/views/401.vue
@@ -44,39 +44,39 @@
<script>
  export default {
    name: 'Page401',
  name: "Page401",
    data() {
      return {
        jumpTime: 5,
        oops: '抱歉!',
        headline: '您没有操作权限...',
        info: '当前帐号没有操作权限,请联系管理员。',
        btn: '返回',
      oops: "抱歉!",
      headline: "您没有操作权限...",
      info: "当前帐号没有操作权限,请联系管理员。",
      btn: "返回",
        timer: 0,
      }
    };
    },
    mounted() {
      this.timeChange()
    this.timeChange();
    },
    beforeDestroy() {
      clearInterval(this.timer)
    clearInterval(this.timer);
    },
    methods: {
      timeChange() {
        this.timer = setInterval(() => {
          if (this.jumpTime) {
            this.jumpTime--
          this.jumpTime--;
          } else {
            this.$router.push({ path: '/' })
            this.$store.dispatch('tabsBar/delOthersRoutes', {
              path: '/',
            })
            clearInterval(this.timer)
          this.$router.push({ path: "/" });
          this.$store.dispatch("tabsBar/delOthersRoutes", {
            path: "/",
          });
          clearInterval(this.timer);
          }
        }, 1000)
      }, 1000);
      },
    },
  }
};
</script>
<style lang="scss" scoped>