From 8182a354472cf04647b79c6fbc66587e4ceb31aa Mon Sep 17 00:00:00 2001 From: zhoulingpo Date: Wed, 17 May 2023 16:13:58 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=96=B0=E5=A2=9E=E3=80=91=E6=96=B0?= =?UTF-8?q?=E5=A2=9Esso?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/modules/sso.js | 12 +++++ src/router/modules/default.js | 28 ++++++++++-- src/views/checkPage.vue | 82 +++++++++++++++++++++++++++++++++++ 3 files changed, 118 insertions(+), 4 deletions(-) create mode 100644 src/api/modules/sso.js create mode 100644 src/views/checkPage.vue diff --git a/src/api/modules/sso.js b/src/api/modules/sso.js new file mode 100644 index 0000000..02ba36b --- /dev/null +++ b/src/api/modules/sso.js @@ -0,0 +1,12 @@ +import { instance as request } from '@/utils/request' + +export default { + // 登录 + ssoLogin(data) { + return request({ + url: '/api/ssoLogin', + method: 'get', + params:data + }) + }, +} diff --git a/src/router/modules/default.js b/src/router/modules/default.js index 10bdfa6..0e51212 100644 --- a/src/router/modules/default.js +++ b/src/router/modules/default.js @@ -1,3 +1,6 @@ +const isDev = process.env.NODE_ENV && process.env.NODE_ENV === 'development' +console.log(isDev,"process.env.") +let myUrl=encodeURI('http://10.0.1.14:8080/checkPage') const routes = [ { path: '/system', @@ -15,16 +18,33 @@ const routes = [ }, { path: '/', - redirect: { - name: 'Login' - // path: '/report/list?id=XBFBR7UADZ' - } + redirect: () => { + window.location.href ='https://iamuat.faw-vw.com/esc-sso/oauth2.0/authorize/old?isADSSO=true&response_type=code&client_id=&redirect_uri='+myUrl + } + // window.location.href = "https://sso-qa.saicmotortest.com/idp/oauth2/authorize?redirect_uri=https://www.baidu.com/&state=gsrm&client_id=GSRM&response_type=code" + + }, + { + path: '/checkPage', + component: () => import('../../views/checkPage.vue') + }, // 登录 { path: '/login', name: 'Login', + redirect: () => { + window.location.href ='https://iamuat.faw-vw.com/esc-sso/oauth2.0/authorize/old?isADSSO=true&response_type=code&client_id=&redirect_uri='+myUrl + // window.location.href = "https://sso-qa.saicmotortest.com/idp/oauth2/authorize?redirect_uri=https://www.baidu.com/&state=gsrm&client_id=GSRM&response_type=code" + } + // window.location.href = "https://sso-qa.saicmotortest.com/idp/oauth2/authorize?redirect_uri=https://www.baidu.com/&state=gsrm&client_id=GSRM&response_type=code" + }, + // 登录 + { + path: '/loginout', + name: 'Login', component: () => import('../../views/Login.vue') + // window.location.href = "https://sso-qa.saicmotortest.com/idp/oauth2/authorize?redirect_uri=https://www.baidu.com/&state=gsrm&client_id=GSRM&response_type=code" }, // // 注册 // { diff --git a/src/views/checkPage.vue b/src/views/checkPage.vue new file mode 100644 index 0000000..b29c9a4 --- /dev/null +++ b/src/views/checkPage.vue @@ -0,0 +1,82 @@ + + + + +