@@ -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 {