Browse Source

学校标识

Xiao_123 1 month ago
parent
commit
d399c3b859
2 changed files with 6 additions and 1 deletions
  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 showBall = ref(false)
 const showTeacherLogin = ref(false)
 const showTeacherLogin = ref(false)
+const isSchool = localStorage.getItem('isSchool') ? true : false
 
 
 // 获取老师注册信息
 // 获取老师注册信息
 const schoolInfo = ref({})
 const schoolInfo = ref({})
@@ -161,7 +162,7 @@ const getSchoolInfo = async () => {
   const data = await getSchoolInformation()
   const data = await getSchoolInformation()
   if (data && Object.keys(data).length > 0) {
   if (data && Object.keys(data).length > 0) {
     schoolInfo.value = data
     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) {
       async getSchoolInfo (isRegister = false) {
         const data = await getSchoolInformation()
         const data = await getSchoolInformation()
+
+        // 存储学校登录标识
+        localStorage.setItem('isSchool', 1)
+
         this.schoolInfo = data || {}
         this.schoolInfo = data || {}
         localStorage.setItem('schoolInfo', data ? JSON.stringify(data) : '{}')
         localStorage.setItem('schoolInfo', data ? JSON.stringify(data) : '{}')