From a128d99df306bb1ab017b7069fb0441837b3917b Mon Sep 17 00:00:00 2001
From: zhanghua <314079846@qq.com>
Date: 星期一, 13 十月 2025 10:04:35 +0800
Subject: [PATCH] 导出加参数
---
src/views/login/index.vue | 42 +++++++++++++++++++++++++++++++-----------
1 files changed, 31 insertions(+), 11 deletions(-)
diff --git a/src/views/login/index.vue b/src/views/login/index.vue
index 5ede3fc..ae5111e 100644
--- a/src/views/login/index.vue
+++ b/src/views/login/index.vue
@@ -2,13 +2,8 @@
<div class="login-container">
<div class="wxLogin">
<el-card class="main_wx">
- <wxlogin
- :appid="appid"
- :redirect_uri="redirect_uri"
- scope="snsapi_login"
- :href="href"
- :state="state"
- ></wxlogin>
+ <wxlogin :appid="appid" :redirect_uri="redirect_uri" scope="snsapi_login" :href="href" :state="state">
+ </wxlogin>
</el-card>
</div>
</div>
@@ -18,6 +13,7 @@
import { validUsername } from "@/utils/validate";
import wxlogin from "vue-wxlogin";
import { login } from "@/api/user";
+import { findStaffByUserId } from "@/api/staff";
export default {
name: "Login",
components: { wxlogin },
@@ -88,9 +84,31 @@
login({
code: code,
}).then((res) => {
- sessionStorage.setItem("user", JSON.stringify(res));
- sessionStorage.setItem("staffs", JSON.stringify(res.staffs));
- sessionStorage.setItem("selectStaff", JSON.stringify(res.staffs[0]));
+ localStorage.setItem("user", JSON.stringify(res));
+ localStorage.setItem("staffs", JSON.stringify(res.staffs));
+ localStorage.setItem("selectStaff", JSON.stringify(res.staffs[0]));
+
+ // 鍒ゆ柇鏄惁涓哄彯褰撶鐞嗗憳璐﹀彿
+ var isAdmin = false
+ res.staffs.forEach(o => {
+ if (o.org.orgType === "PLATFORM") {
+ isAdmin = true;
+ }
+ })
+
+ if (isAdmin) {
+ findStaffByUserId(res.id).then(sres => {
+
+ if (sres.data && sres.data.findStaffByUserId) {
+ var staffs = sres.data.findStaffByUserId;
+ localStorage.setItem("staffs", JSON.stringify(staffs));
+ localStorage.setItem("selectStaff", JSON.stringify(staffs[0]));
+
+ this.$EventBus.$emit("updateStaffs", '123');
+ }
+ })
+ }
+
this.$router.push("/student");
});
},
@@ -164,6 +182,7 @@
display: flex;
align-items: center;
justify-content: center;
+
.el-input {
display: inline-block;
height: 47px;
@@ -193,6 +212,7 @@
color: #454545;
}
}
+
#weixin {
/* background-color: #fcf; */
display: flex;
@@ -264,7 +284,7 @@
}
}
-.main_wx{
+.main_wx {
height: 360px;
margin-bottom: 100px;
}
--
Gitblit v1.8.0