Xiao_123 1 mēnesi atpakaļ
vecāks
revīzija
d399c3b859
2 mainītis faili ar 6 papildinājumiem un 1 dzēšanām
  1. 2 1
      src/layout/personal/navBar.vue
  2. 4 0
      src/store/user.js

+ 2 - 1
src/layout/personal/navBar.vue

@@ -154,6 +154,7 @@ defineProps({
 
 const showBall = ref(false)
 const showTeacherLogin = ref(false)
+const isSchool = localStorage.getItem('isSchool') ? true : false
 
 // 获取老师注册信息
 const schoolInfo = ref({})
@@ -161,7 +162,7 @@ const getSchoolInfo = async () => {
   const data = await getSchoolInformation()
   if (data && Object.keys(data).length > 0) {
     schoolInfo.value = data
-    showTeacherLogin.value = true
+    showTeacherLogin.value = isSchool ? false : true
   }
 }
 

+ 4 - 0
src/store/user.js

@@ -274,6 +274,10 @@ export const useUserStore = defineStore('user',
       // 获取学校基本信息
       async getSchoolInfo (isRegister = false) {
         const data = await getSchoolInformation()
+
+        // 存储学校登录标识
+        localStorage.setItem('isSchool', 1)
+
         this.schoolInfo = data || {}
         localStorage.setItem('schoolInfo', data ? JSON.stringify(data) : '{}')