From 20a839796055920982250b0eb099a2aabe37d91a Mon Sep 17 00:00:00 2001 From: lmj <3407000732@qq.com> Date: Wed, 22 Jun 2022 11:47:20 +0800 Subject: [PATCH] =?UTF-8?q?case=E7=BD=91=E7=BB=9C=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/portal/case/Detail.vue | 71 +++++++++++++++++++++++++++++++- 1 file changed, 69 insertions(+), 2 deletions(-) diff --git a/src/views/portal/case/Detail.vue b/src/views/portal/case/Detail.vue index d6442ca6..c65c082e 100644 --- a/src/views/portal/case/Detail.vue +++ b/src/views/portal/case/Detail.vue @@ -43,12 +43,19 @@ - + + + 案例内容只能在内网环境下查看 + + + 网络安全检测中 + +
@@ -187,6 +194,7 @@ export default { }, data() { return { + Internet:3,//1是成功 2是是失败 3是检测中 noData:true, zoomShow:true, isTopBoxShow:true, @@ -209,7 +217,36 @@ export default { }; }, mounted() { - //this.pdfPath=this.basePath+'/case/demo1.pdf'; + let $this = this; + this.Intsucc(); + let xmlhttp=this.getXmlHttpRequest(); + let timedOut = false; + let timer = setTimeout(function(){ + timedOut = true; + xmlhttp.abort(); + }, 5000); + // xmlhttp.open("HEAD", "http://10.251.132.75/web",true); + xmlhttp.open("HEAD", "https://u-pre.boe.com/web",true); + xmlhttp.send(); + xmlhttp.onreadystatechange=function() { + // console.log(xmlhttp.readyState,"xmlhttp.readyState"); + if (xmlhttp.readyState==4) { + console.log(xmlhttp.status,"xmlhttp.status"); + if (xmlhttp.status==200){ + clearTimeout(timer); + $this.Internet = 1; + }else{ + clearTimeout(timer); + $this.Internet = 2; + + } + }else{ + if(imedOut) return;//忽略中止请求 + clearTimeout(timer);//取消等待的超时 + } + } + + this.resolveId = this.$route.query.id; this.$watermark.set(this.userInfo.name+this.userInfo.loginName); if (this.resolveId) { @@ -226,6 +263,27 @@ export default { ); }, methods: { + getXmlHttpRequest() { + if (window.XMLHttpRequest) { + return new XMLHttpRequest(); + } + else if (window.ActiveXObject) { + return new ActiveXObject("Microsoft.XMLHTTP"); + } + }, + Intsucc(){ + const loading = this.$loading({ + lock: true, + text: '正在进行安全检测', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }); + setTimeout(() => { + loading.close(); + }, 2000); + + }, + getdomain() { let key = "org_domain"; apiDict.items(key).then(res => { @@ -406,6 +464,15 @@ export default {