From aa81d2c005e040df79c418eb195f48a6ef5124aa Mon Sep 17 00:00:00 2001 From: dengbf Date: Mon, 25 Dec 2023 10:25:38 +0800 Subject: [PATCH] =?UTF-8?q?-=20[=E4=BF=AE=E5=A4=8D]=20=E8=A1=A5=E5=85=85?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E8=B7=B3=E8=BD=AC=E6=A0=A1=E9=AA=8C=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=20=20=20=20-=20[=E5=85=B3=E8=81=94]=20#[1052200090959?= =?UTF-8?q?872]=E8=8F=9C=E5=8D=95=E7=AE=A1=E7=90=86-=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=EF=BC=8C=E6=97=A0=E6=B3=95=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=20http://192.168.0.96:8090/demo/rdm.html#/bug-detail/939050947?= =?UTF-8?q?543040/939050947543057/1052200090959872?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/components/topnav/topnav-extramenu.vue | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/views/components/topnav/topnav-extramenu.vue b/src/views/components/topnav/topnav-extramenu.vue index a49bf5452..1a95f4974 100644 --- a/src/views/components/topnav/topnav-extramenu.vue +++ b/src/views/components/topnav/topnav-extramenu.vue @@ -55,11 +55,23 @@ export default { changeMenu(val, selectedData) { if (!this.$utils.isEmpty(selectedData) && selectedData[selectedData.length - 1].url) { let url = selectedData[selectedData.length - 1].url; - window.open(url, '_blank'); + if (url && this.checkUrl(url)) { + window.open(url, '_blank'); + } } }, onVisibleChange() { this.selecteData = []; + }, + checkUrl(string) { + let givenURL; + try { + givenURL = new URL(string); + } catch (error) { + this.$Notice.error({ title: 'URL' + this.$t('page.exception'), desc: error}); + return false; + } + return true; } }, filter: {}, -- Gitee