lsc il y a 1 semaine
Parent
commit
4a5df0199c
1 fichiers modifiés avec 9 ajouts et 1 suppressions
  1. 9 1
      src/views/Student/index.vue

+ 9 - 1
src/views/Student/index.vue

@@ -1907,8 +1907,12 @@ const checkParentMode = () => {
 }
 
 const forceLogout = () => {
+  sendMessage({ type: 'logout' })
+}
+
+const logout = () => {
   // @ts-ignore
-  if (window.parent && typeof window.parent.topU.U.MD.U.LO.logoutSystemQ === 'function' && props.type == '2') {
+  if (window.parent && typeof window.parent.topU.U.MD.U.LO.logoutSystemQ === 'function') {
     // @ts-ignore
     window.parent.topU.U.MD.U.LO.logoutSystemQ()
   }
@@ -1979,6 +1983,10 @@ const getMessages = (msgObj: any) => {
     selectCourseSLook()
   }
   
+  if (props.type == '2' && msgObj.type === 'logout') {
+    logout()
+  }
+
   // 处理作业提交消息 - 当有人提交作业时,重新获取作业数据
   if (props.type == '1' && msgObj.type === 'homework_submitted' && msgObj.courseid === props.courseid) {
     console.log('收到作业提交消息,重新获取作业数据')