From d319c676580c2911ef2bbccec7a50de257bee72e Mon Sep 17 00:00:00 2001 From: dai <851733175@qq.com> Date: Thu, 20 Oct 2022 09:15:26 +0800 Subject: [PATCH 1/4] 1 --- src/views/pages/yantai-login-transit.vue | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/src/views/pages/yantai-login-transit.vue b/src/views/pages/yantai-login-transit.vue index d884e0367..7dff55273 100644 --- a/src/views/pages/yantai-login-transit.vue +++ b/src/views/pages/yantai-login-transit.vue @@ -23,6 +23,7 @@ export default { async mounted() { let code = getQueryPara("code"); + console.log("------------------code", code); const loading = this.$loading({ lock: true, text: "登录中……", @@ -34,29 +35,13 @@ export default { await this.login(code); loading.close(); } else { - // await this.skip(code); - location.href = - "http://172.20.46.155:8080/sso/login?client_id=1000006&redirect_url=" + - encodeURIComponent(location.href); + // location.href = + // "http://172.20.46.155:8080/sso/login?client_id=1000006&redirect_url=" + + // encodeURIComponent(location.href); } }, methods: { - //根据社区id获取小区列表 - async skip() { - const url = "/gov222"; - - let params = {}; - - const { data, code, msg } = await requestPost(url, params); - - if (code === 0) { - location.href = data.url; - } else { - console.log("获取跳转页面失败", msg); - } - }, - //根据社区id获取小区列表 async login(client_code) { const url = "/auth/sso-govlogin-yantai/" + client_code; From 59985cf7f26198a2213ba16d45bb9f9d2cd7578e Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 20 Oct 2022 09:19:13 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E8=81=94=E8=B0=83=E4=BD=BF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/pages/yantai-login-transit.vue | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/views/pages/yantai-login-transit.vue b/src/views/pages/yantai-login-transit.vue index d884e0367..41e6f00a5 100644 --- a/src/views/pages/yantai-login-transit.vue +++ b/src/views/pages/yantai-login-transit.vue @@ -23,6 +23,7 @@ export default { async mounted() { let code = getQueryPara("code"); + alert(code+"location.href;"+location.href); const loading = this.$loading({ lock: true, text: "登录中……", @@ -35,9 +36,11 @@ export default { loading.close(); } else { // await this.skip(code); - location.href = - "http://172.20.46.155:8080/sso/login?client_id=1000006&redirect_url=" + - encodeURIComponent(location.href); + let uriComponent = "http://172.20.46.177/epmet-oper-gov/#/login/"; + //let uriComponent = "https://172.20.46.177:65221/#/"; + let redirect_url = encodeURIComponent(uriComponent); + let url = "http://172.20.46.155:8080/sso/login?client_id=1000009&redirect_url="+redirect_url; + window.open(url,'_self'); } }, From b62149cfacd6736142f2ed8b8a207ea404b6a330 Mon Sep 17 00:00:00 2001 From: dai <851733175@qq.com> Date: Thu, 20 Oct 2022 09:32:48 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=BC=BA=E8=A1=8C=E5=85=BC=E5=AE=B9?= =?UTF-8?q?=E6=96=9C=E6=9D=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 12 +++++++++++- src/views/pages/yantai-login-transit.vue | 25 +++++------------------- 2 files changed, 16 insertions(+), 21 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index d047bac98..048b4ceb6 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -38,7 +38,7 @@ export const pageRoutes = [ }, }, { - path: "/login", + path: "/login/", component: () => { return import("@/views/pages/yantai-login-transit"); }, @@ -47,6 +47,16 @@ export const pageRoutes = [ title: "登录", }, }, + { + path: "/login", + component: () => { + return import("@/views/pages/yantai-login-transit"); + }, + name: "login2", + meta: { + title: "登录", + }, + }, { path: "/", name: "index", diff --git a/src/views/pages/yantai-login-transit.vue b/src/views/pages/yantai-login-transit.vue index 41e6f00a5..fa04f4a72 100644 --- a/src/views/pages/yantai-login-transit.vue +++ b/src/views/pages/yantai-login-transit.vue @@ -23,7 +23,7 @@ export default { async mounted() { let code = getQueryPara("code"); - alert(code+"location.href;"+location.href); + console.log("--------------code" + code); const loading = this.$loading({ lock: true, text: "登录中……", @@ -35,31 +35,16 @@ export default { await this.login(code); loading.close(); } else { - // await this.skip(code); let uriComponent = "http://172.20.46.177/epmet-oper-gov/#/login/"; - //let uriComponent = "https://172.20.46.177:65221/#/"; let redirect_url = encodeURIComponent(uriComponent); - let url = "http://172.20.46.155:8080/sso/login?client_id=1000009&redirect_url="+redirect_url; - window.open(url,'_self'); + let url = + "http://172.20.46.155:8080/sso/login?client_id=1000009&redirect_url=" + + redirect_url; + // window.open(url, "_self"); } }, methods: { - //根据社区id获取小区列表 - async skip() { - const url = "/gov222"; - - let params = {}; - - const { data, code, msg } = await requestPost(url, params); - - if (code === 0) { - location.href = data.url; - } else { - console.log("获取跳转页面失败", msg); - } - }, - //根据社区id获取小区列表 async login(client_code) { const url = "/auth/sso-govlogin-yantai/" + client_code; From f81be39a41c0a94e4e3d591435ed6536bbc2fe26 Mon Sep 17 00:00:00 2001 From: dai <851733175@qq.com> Date: Thu, 20 Oct 2022 09:33:25 +0800 Subject: [PATCH 4/4] 2 --- src/views/pages/yantai-login-transit.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/pages/yantai-login-transit.vue b/src/views/pages/yantai-login-transit.vue index fa04f4a72..fa49f33c6 100644 --- a/src/views/pages/yantai-login-transit.vue +++ b/src/views/pages/yantai-login-transit.vue @@ -40,7 +40,7 @@ export default { let url = "http://172.20.46.155:8080/sso/login?client_id=1000009&redirect_url=" + redirect_url; - // window.open(url, "_self"); + window.open(url, "_self"); } },