From 539f3337b44b632eccbe120b3eaf59e4125c9e28 Mon Sep 17 00:00:00 2001 From: shil <452061493@qq.com> Date: Fri, 14 Aug 2026 14:48:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=81=E4=B8=9A=E8=BF=94=E5=9B=9E=E5=9C=B0?= =?UTF-8?q?=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/globalExpandRouter.js | 24 ++++++++++++++++++------ src/views/Home.vue | 2 +- src/views/enforceHome.vue | 10 ++++++++-- 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/src/common/globalExpandRouter.js b/src/common/globalExpandRouter.js index 6dd5748..a3cd2d5 100644 --- a/src/common/globalExpandRouter.js +++ b/src/common/globalExpandRouter.js @@ -50,21 +50,33 @@ const getBusKey = (name, path, data) => { // 添加扩展方法 const $globalExpandRouter = (router, routes) => { // 扩展push方法 - const routerPush = router.push; + const routerPush = router.push.bind(router); router.push = (location) => { - const { name = "", path = "" } = location; + const name = typeof location === "object" && location ? location.name || "" : ""; + const path = + typeof location === "object" && location + ? location.path || "" + : typeof location === "string" + ? location + : ""; const subMsgKey = getBusKey(name, path, routes); - return routerPush.call(this, location).then(() => { + return routerPush(location).then(() => { subMsgKey && $globalEventBus.emit(subMsgKey); }); }; // 扩展replace方法 - const routerReplace = router.replace; + const routerReplace = router.replace.bind(router); router.replace = (location) => { - const { name = "", path = "" } = location; + const name = typeof location === "object" && location ? location.name || "" : ""; + const path = + typeof location === "object" && location + ? location.path || "" + : typeof location === "string" + ? location + : ""; const subMsgKey = getBusKey(name, path, routes); - return routerReplace.call(this, location).then(() => { + return routerReplace(location).then(() => { subMsgKey && $globalEventBus.emit(subMsgKey); }); }; diff --git a/src/views/Home.vue b/src/views/Home.vue index 6083812..72925ef 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -223,7 +223,7 @@ getSiqLoginAuth({code: res.result.result.code}, success => { // todo 测试时指定账号去2.0版本 start. - if(success.data.userId=="17608629742"||success.data.userId=="2064275054386966530"||success.data.userId=="2064274295779979265"){ + if(success.data.userId=="17608645550" && (success.data.area || "").includes("宝安区")){ window.location.href="http://jdm.szssfj.cn/efcode20-ent-app/enterprise/enterpriseHome"; return; } diff --git a/src/views/enforceHome.vue b/src/views/enforceHome.vue index 2b83c63..59c8666 100644 --- a/src/views/enforceHome.vue +++ b/src/views/enforceHome.vue @@ -291,8 +291,14 @@ onMounted(() => { getSzyptLoginAuth( code, (success) => { - // todo 测试时指定账号去2.0版本 start. - if(success.data.userId==17608417058 || success.data.userId==7897){ + // todo 测试时指定账号去2.0版本 start. <宝安> + if(success.data.userId==17608417317 && success.data.area=="20210922211905159-EE09-09D606CFB"){ + // if(success.data.userId==17608417058){ + // window.location.href="http://jdm.szssfj.cn/efcode20-enf-app/enforcement/loginByV1System?loginUserId=d76453e3-6945-4b02-9943-efbd0e8aee9e"; + window.location.href="https://weixin-hlht.sz.gov.cn:30443/connect/oauth2/authorize?appid=wwf62d6d16d1182b4f&redirect_uri=http://jdm.szssfj.cn/efcode20-enf-app/enforcement/enforcementHome&response_type=code&scope=SCOPE&agentid=1000015&state=STATE#wechat_redirect"; + return; + } + if(success.data.userId==7897){ // if(success.data.userId==17608417058){ // window.location.href="http://jdm.szssfj.cn/efcode20-enf-app/enforcement/loginByV1System?loginUserId=d76453e3-6945-4b02-9943-efbd0e8aee9e"; window.location.href="https://weixin-hlht.sz.gov.cn:30443/connect/oauth2/authorize?appid=wwf62d6d16d1182b4f&redirect_uri=http://jdm.szssfj.cn/efcode20-enf-app/enforcement/enforcementHome&response_type=code&scope=SCOPE&agentid=1000015&state=STATE#wechat_redirect";