From 22a243868482c7bfa51d5bf7ffc5560a0c3f634f Mon Sep 17 00:00:00 2001 From: 670788339 <670788339@qq.com> Date: Mon, 21 Jul 2025 21:35:20 +0800 Subject: [PATCH] =?UTF-8?q?0720=E6=89=93=E5=8C=85-=E4=BB=85=E5=86=85?= =?UTF-8?q?=E7=BD=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/study/courseStudy.vue | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/pages/study/courseStudy.vue b/pages/study/courseStudy.vue index 4ddac0b..a9d1a14 100644 --- a/pages/study/courseStudy.vue +++ b/pages/study/courseStudy.vue @@ -5,7 +5,7 @@ - + @@ -115,7 +115,7 @@ - +
十分抱歉,您当前的网络环境不符合观看要求。为了保障课程信息的安全,您需要接入公司内网才能观看。
@@ -522,7 +522,8 @@ Internet: 3,//1是成功 2是是失败 3是检测中 protocolDialogVisible:false, warn:"测试内容", - warnTitle:"测试提示" + warnTitle:"测试提示", + renderCourse:true } }, computed: { @@ -569,6 +570,7 @@ }, }, onLoad(options) { + this.getInternet(); //this.$watermark.set(this.userInfo.name+ this.userInfo.loginName); this.scrollItemWidth=(this.$width-100)/2;//横向滚动的内容块宽度 this.treePopupWidth=(this.$width-100)+'px'; //右边出来的抽屉宽度控制 @@ -637,7 +639,8 @@ return new ActiveXObject("Microsoft.XMLHTTP"); } }, - getInternet(){ + // 检测是否为内网 + getInternet() { this.Internet = 3; let $this = this; let xmlhttp = this.getXmlHttpRequest(); @@ -645,7 +648,7 @@ let timer = setTimeout(function () { timedOut = true; xmlhttp.abort(); - }, 5000); + }, 1000); xmlhttp.open("HEAD", window.location.protocol + "//uapi.boe.com.cn/500.html", true); xmlhttp.send(); xmlhttp.onreadystatechange = function () { @@ -655,8 +658,8 @@ $this.Internet = 1; } else { clearTimeout(timer); + // $this.protocolDialogVisible=true $this.Internet = 2; - $this.protocolDialogVisible=true } } else { if (timedOut) return;//忽略中止请求 @@ -698,6 +701,14 @@ apiCourseStudy.studyIndex(this.courseId).then(rs=>{ console.log("是这个") if(rs.status != 200) { + if (!rs.result.isPermission || (rs.result.isPermission && this.Internet==1)){ + // this.getInternet() + this.renderCourse = true + }else{ + // this.Internet=1; + this.renderCourse = false + this.protocolDialogVisible=true + } uni.hideLoading(); uni.showToast({title:rs.message,type:'fail'}); //$this.$refs.messager.show({message:rs.message,type:'error'}); @@ -840,10 +851,6 @@ //this.curContent=this.contentList[0]; this.playContent(this.curContent,0); } - if(rs.result.isPermission){ - this.getInternet() - console.log("需要内网环境") - } uni.hideLoading(); });