From 5eaf34ed1b16441ad76f97b697e5bc109ab6a685 Mon Sep 17 00:00:00 2001 From: fhysy <1149505133@qq.com> Date: Wed, 25 Dec 2024 17:01:46 +0800 Subject: [PATCH] =?UTF-8?q?=20fast(=E7=9B=91=E6=8E=A7=E5=A4=A7=E5=B1=8F):?= =?UTF-8?q?=20=E7=9B=91=E5=90=AC=E5=A4=A7=E5=B1=8F=E6=B7=BB=E5=8A=A0iframe?= =?UTF-8?q?=E7=9B=91=E5=90=AC=E6=96=B9=E6=B3=95=EF=BC=8C=E5=B0=81=E8=A3=85?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E6=96=B9=E6=B3=95=EF=BC=8C=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=B7=BB=E5=8A=A0url=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E8=AF=86=E5=88=AB=EF=BC=8C=E8=A7=A3=E5=86=B3=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E5=AF=BC=E8=88=AA=E6=8A=A5=E9=94=99=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 12 ++++++-- src/views/bigScreenIframe/index.vue | 44 ++++++++++++++++++++++++++--- src/views/iot/device/index.vue | 3 ++ 3 files changed, 53 insertions(+), 6 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index 6e6c116a..97b51fa5 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -2,7 +2,14 @@ import Vue from 'vue' import Router from 'vue-router' Vue.use(Router) - +const RouterPush = Router.prototype.push +Router.prototype.push = function push (to) { + return RouterPush.call(this, to).catch(err => err) +} +const RouterReplace = Router.prototype.replace +Router.prototype.replace = function replace (to) { + return RouterReplace.call(this, to).catch(err => err) +} /* Layout */ import Layout from '@/layout' import ParentView from '@/components/ParentView'; @@ -305,5 +312,6 @@ export const constantRoutes = [ export default new Router({ mode: 'history', // 去掉url中的# scrollBehavior: () => ({ y: 0 }), - routes: constantRoutes + routes: constantRoutes, + ignoreDuplicates: true }) diff --git a/src/views/bigScreenIframe/index.vue b/src/views/bigScreenIframe/index.vue index 1f15e438..4c20d972 100644 --- a/src/views/bigScreenIframe/index.vue +++ b/src/views/bigScreenIframe/index.vue @@ -5,6 +5,7 @@