龚焕茏
2024-09-12 4ed702e8ca51cf7750d3d10025456f539f24823a
调整
2个文件已修改
36 ■■■■■ 已修改文件
src/layout/index.vue 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/student/index.vue 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/layout/index.vue
@@ -44,23 +44,9 @@
    }
  },
  mounted() {
    // 获取地址栏code
    let code = this.$route.query.code;
    if (code) {
      this.getUserDate(code);
    }
    //  else {
    //     this.$router.push("/login");
    // }
  },
  methods: {
    getUserDate(code) {
      login({
        code: code,
      }).then((res) => {
        localStorage.setItem("user", JSON.stringify(res));
      });
    },
    handleClickOutside() {
      this.$store.dispatch('app/closeSideBar', { withoutAnimation: false })
    }
src/views/student/index.vue
@@ -158,9 +158,27 @@
    };
  },
  created() {
    this.fetchData();
    // 获取地址栏code
    let code = this.$route.query.code;
    if (code) {
      this.getUserDate(code);
    }
    //  else {
    //     this.$router.push("/login");
    // }
    if (localStorage.getItem("user")) {
      this.fetchData();
    }
  },
  methods: {
    getUserDate(code) {
      login({
        code: code,
      }).then((res) => {
        localStorage.setItem("user", JSON.stringify(res));
        this.fetchData();
      });
    },
    handleExport() {
      this.download('exportPlayer', {
      }, `导出_${new Date().getTime()}.xlsx`)