0720打包-仅内网

This commit is contained in:
670788339
2025-07-21 21:35:20 +08:00
parent 334856641d
commit 22a2438684

View File

@@ -5,7 +5,7 @@
<u-toast ref="messager"></u-toast>
<!-- <page-title :showBack="true"></page-title> -->
<view class="playbox" v-if="isShowPdt"><!--内容播放区域-->
<view v-if="Internet != 2">
<view v-if="renderCourse">
<view style="min-height: 440upx;" >
<view v-if="curContent.contentType==10" style="background-color: #000000;">
<!--视频-->
@@ -115,7 +115,7 @@
</view>
</view>
</view>
<view v-if="Internet == 2">
<view v-if="!renderCourse && Internet ==2">
<div style="margin-top:40px">
<span style="font-size: large">十分抱歉您当前的网络环境不符合观看要求为了保障课程信息的安全您需要接入公司内网才能观看</span>
</div>
@@ -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();
});