From 0a87850bce2e6fb59d0e3ce9889a45a425d94dcf Mon Sep 17 00:00:00 2001 From: wxz Date: Tue, 24 Sep 2024 09:50:55 +0800 Subject: [PATCH 1/3] =?UTF-8?q?add:=E5=A6=82=E6=9E=9C=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E8=B7=AF=E7=94=B1=E4=B8=BAtarget=3D=5Fblank,=E5=88=99=E7=94=A8?= =?UTF-8?q?window.open()=E6=89=93=E5=BC=80=E6=96=B0=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index 2702594d8..0ad413443 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -942,9 +942,20 @@ const router = new Router({ }), routes: pageRoutes.concat(moduleRoutes, moduleShujuRoutes, dataBoardRoutes), }); + router.beforeEach((to, from, next) => { // 添加动态(菜单)路由 // 已添加或者当前路由为页面路由, 可直接访问 + let toUrl = to.meta.iframeURL + if (toUrl && toUrl.indexOf("target=_blank") != -1) { + // 此处请求后端,获取一个ticket票据 + http.get("/auth/sso/getTicket") + .then(({data: res}) => { + let ticket = res.data + window.open(toUrl + ticket) + }) + return null; + } if (to.name === "caiji") { return next(); } @@ -982,7 +993,7 @@ router.beforeEach((to, from, next) => { }); return next({ name: "login", - query: { redirect: to.fullPath } + query: { redirect: to.fullPath } }); } window.SITE_CONFIG["menuShujuList"] = res.data; @@ -996,7 +1007,7 @@ router.beforeEach((to, from, next) => { console.log(err); next({ name: "login", - query: { redirect: to.fullPath } + query: { redirect: to.fullPath } }); }); http @@ -1013,7 +1024,7 @@ router.beforeEach((to, from, next) => { }); return next({ name: "login", - query: { redirect: to.fullPath } + query: { redirect: to.fullPath } }); } window.SITE_CONFIG["menuList"] = res.data @@ -1031,7 +1042,7 @@ router.beforeEach((to, from, next) => { console.log(err); next({ name: "login", - query: { redirect: to.fullPath } + query: { redirect: to.fullPath } }); }); }); From de5422a404c6f23601e52b698e0aae7365281803 Mon Sep 17 00:00:00 2001 From: wxz Date: Tue, 24 Sep 2024 18:19:30 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E9=92=88=E5=AF=B9=E5=BF=97=E6=84=BF?= =?UTF-8?q?=E5=95=86=E5=9F=8E=E6=8E=A5=E5=85=A5=E4=BF=AE=E6=94=B9=E8=B7=AF?= =?UTF-8?q?=E7=94=B1=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/router/index.js b/src/router/index.js index 0ad413443..597bc3b38 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -947,7 +947,8 @@ router.beforeEach((to, from, next) => { // 添加动态(菜单)路由 // 已添加或者当前路由为页面路由, 可直接访问 let toUrl = to.meta.iframeURL - if (toUrl && toUrl.indexOf("target=_blank") != -1) { + console.log("=====", toUrl) + if (toUrl && toUrl.indexOf("ticket=") != -1) { // 此处请求后端,获取一个ticket票据 http.get("/auth/sso/getTicket") .then(({data: res}) => { From e672be1324e2947185d7ba776a4373a1b88a9d0c Mon Sep 17 00:00:00 2001 From: wxz Date: Thu, 26 Sep 2024 09:33:37 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=A2=9E=E5=8A=A0localhost=E9=85=8D?= =?UTF-8?q?=E7=BD=AE,=E5=90=8E=E7=AB=AF=E8=87=AA=E5=B7=B1=E7=94=A8?= =?UTF-8?q?=E7=9A=84,?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.localhost | 19 +++++++++++++++++++ package.json | 1 + 2 files changed, 20 insertions(+) create mode 100644 .env.localhost diff --git a/.env.localhost b/.env.localhost new file mode 100644 index 000000000..9c8490046 --- /dev/null +++ b/.env.localhost @@ -0,0 +1,19 @@ +NODE_ENV=development + +# VUE_APP_API_SERVER = https://epmet-preview.elinkservice.cn/api +# VUE_APP_API_SERVER = http://192.168.1.60:8080/api +VUE_APP_API_SERVER = http://localhost:8080/api +# VUE_APP_API_SERVER = http://219.146.91.110:30801/api219.146.91.110:30801 +# VUE_APP_API_SERVER = https://epmet-yantai.elinkservice.cn/api +# VUE_APP_API_SERVER = https://epmet-test.elinkservice.cn/api +# VUE_APP_API_SERVER = https://epmet-cloud.elinkservice.cn/api +# VUE_APP_API_SERVER = https://epdc-shibei.elinkservice.cn/api +# VUE_APP_API_SERVER = https://epmet-dev.elinkservice.cn:41080/api +# VUE_APP_API_SERVER = https://epmet-dev.elinkservice.cn/api + +VUE_APP_BIPASS_API_SERVER = /linkdata/linkdata-gateway/route + +# VUE_APP_NODE_ENV=dev_sdtdt +VUE_APP_NODE_ENV=dev +#项目根路径 +VUE_APP_PUBLIC_PATH=epmet-oper diff --git a/package.json b/package.json index 1bb574cc2..5ce162d98 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "1.0.0", "private": true, "scripts": { + "localhost": "node --max_old_space_size=4096 node_modules/@vue/cli-service/bin/vue-cli-service.js serve --mode localhost", "dev": "node --max_old_space_size=4096 node_modules/@vue/cli-service/bin/vue-cli-service.js serve", "serve": "vue-cli-service serve", "build": "vue-cli-service build",