SanHQin 3 月之前
父节点
当前提交
4f31a94bbe
共有 1 个文件被更改,包括 47 次插入3 次删除
  1. 47 3
      src/components/pages/inviteLoginST/inviteLogin.vue

+ 47 - 3
src/components/pages/inviteLoginST/inviteLogin.vue

@@ -1,5 +1,8 @@
 <template>
     <div class="container" v-loading="loading">
+				<div class="loginOut" v-if="showLoadingOut">
+					<span @click="loginOut">退出登录</span>
+				</div>
 				<div class="c-box">
 					<div class="c-b-left"></div>
 					<div class="c-b-right">
@@ -41,7 +44,8 @@ export default {
             classJuri: [],
             code: this.$route.query.code,
             courseId:"",
-						chooseData:{}
+						chooseData:{},
+						showLoadingOut:false,
         }
     },
     methods: {
@@ -62,8 +66,30 @@ export default {
               "*"
           );
 				}
-			}
-		}
+			},
+			loginOut(){
+				window.parent.postMessage({
+					tools:"logout"
+				})
+			},
+		},
+		mounted() {
+			setInterval(() => {
+				window.parent.postMessage({
+					tools:"getLogin"
+				})
+			}, 2000);
+			window.addEventListener("message",(e)=>{
+				let data = e.data;
+				if(data.tools && data.tools=='getLogin'){
+					if(data.type===2){
+						this.showLoadingOut = false;
+					}else if(data.type===1){
+						this.showLoadingOut = true;
+					}
+				}
+			})
+		},
 }
 </script>
 
@@ -80,6 +106,24 @@ export default {
 		position: relative;
 }
 
+.loginOut{
+	position: absolute;
+	right: 30px;
+	top: 30px;
+	width: auto;
+	height: auto;
+	display: flex;
+	justify-content: center;
+	align-items: center;
+}
+
+.loginOut>span{
+	font-size: 24px;
+	color: #fff;
+	font-weight: bold;
+	cursor: pointer;
+}
+
 .c-box{
 	width: 75%;
 	height: 75%;