From 4ed702e8ca51cf7750d3d10025456f539f24823a Mon Sep 17 00:00:00 2001
From: 龚焕茏 <2842157468@qq.com>
Date: 星期四, 12 九月 2024 10:34:22 +0800
Subject: [PATCH] 调整
---
src/layout/index.vue | 16 +---------------
src/views/student/index.vue | 20 +++++++++++++++++++-
2 files changed, 20 insertions(+), 16 deletions(-)
diff --git a/src/layout/index.vue b/src/layout/index.vue
index dee6d98..76e9193 100644
--- a/src/layout/index.vue
+++ b/src/layout/index.vue
@@ -44,23 +44,9 @@
}
},
mounted() {
- // 鑾峰彇鍦板潃鏍廲ode
- 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 })
}
diff --git a/src/views/student/index.vue b/src/views/student/index.vue
index 905a089..9c20ba2 100644
--- a/src/views/student/index.vue
+++ b/src/views/student/index.vue
@@ -158,9 +158,27 @@
};
},
created() {
- this.fetchData();
+ // 鑾峰彇鍦板潃鏍廲ode
+ 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`)
--
Gitblit v1.8.0