Browse Source

外部链接默认http协议头,没有的话

hbchen 1 year ago
parent
commit
330a69ed97
1 changed files with 7 additions and 1 deletions
  1. 7 1
      src/views/system_manage/outlinkList.vue

+ 7 - 1
src/views/system_manage/outlinkList.vue

@@ -39,7 +39,13 @@ import {outlinkConfigInterence} from "@/api/modules/etaBaseConfigApi.js"
         })
       },
       gotoOutlink(item){
-        window.open(item.Url, '_blank')
+        let Url = item.Url
+        if(!(item.Url.startsWith("http://") || item.Url.startsWith("https://") || item.Url.startsWith("ftp://") || 
+        item.Url.startsWith("ftps://") || item.Url.startsWith("file://") || item.Url.startsWith("\/"))){
+          Url = "http://"+item.Url
+        }
+        // console.log(Url);
+        window.open(Url, '_blank')
       }
     },
   }