十分抱歉,您当前的网络环境不符合观看要求。为了保障课程信息的安全,您需要接入公司内网才能观看。
@@ -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();
});