sso登录

This commit is contained in:
qq787203167
2022-06-10 10:50:00 +08:00
parent a3effc8b36
commit 6636267693
2 changed files with 14 additions and 3 deletions
+5 -1
View File
@@ -223,7 +223,11 @@
return that.Logout({}).then(() => { return that.Logout({}).then(() => {
// update-begin author:wangshuai date:20200601 for: 退出登录跳转登录页面 // update-begin author:wangshuai date:20200601 for: 退出登录跳转登录页面
that.$router.push({ path: '/user/login' }) that.$router.push({ path: '/user/login' })
// window.location.href = 'https://signin-test.nio.com/logout?client_id=100679&redirect_uri=' + encodeURIComponent('http://localhost:3000/dashboard/analysis') + '&response_type=code' // window.location.href = 'https://signin-test.nio.com/logout?client_id=100679&redirect_uri=' +
// encodeURIComponent('http://localhost:3000/dashboard/analysis') + '&response_type=code' //本地
// window.location.href = 'https://signin.nio.com/logout?client_id=100679&redirect_uri=' +
// encodeURIComponent('http://grp.nioint.com/dashboard/analysis') + '&response_type=code' //线上
localStorage.removeItem('language') localStorage.removeItem('language')
// update-end author:wangshuai date:20200601 for: 退出登录跳转登录页面 // update-end author:wangshuai date:20200601 for: 退出登录跳转登录页面
//window.location.reload() //window.location.reload()
+9 -2
View File
@@ -96,8 +96,12 @@ router.beforeEach((to, from, next) => {
} else { } else {
fullPath = to.path fullPath = to.path
} }
// http://grp.nioint.com
// window.location.href = 'https://signin-test.nio.com/oauth2/authorize?client_id=100679&redirect_uri=' // window.location.href = 'https://signin-test.nio.com/oauth2/authorize?client_id=100679&redirect_uri='
// + encodeURIComponent('http://localhost:3000' + fullPath) + '&response_type=code&state=' + JSON.stringify(to.query) // + encodeURIComponent('http://localhost:3000' + fullPath) + '&response_type=code&state=' + JSON.stringify(to.query) //本地
// window.location.href = 'https://signin.nio.com/oauth2/authorize?client_id=100679&redirect_uri='
// + encodeURIComponent('http://grp.nioint.com' + fullPath) + '&response_type=code&state=' + JSON.stringify(to.query) //线上
}) })
}) })
} else { } else {
@@ -118,7 +122,10 @@ router.beforeEach((to, from, next) => {
} }
// http://grp.nioint.com // http://grp.nioint.com
// window.location.href = 'https://signin-test.nio.com/oauth2/authorize?client_id=100679&redirect_uri=' // window.location.href = 'https://signin-test.nio.com/oauth2/authorize?client_id=100679&redirect_uri='
// + encodeURIComponent('http://localhost:3000' + fullPath) + '&response_type=code&state=' + JSON.stringify(to.query) // + encodeURIComponent('http://localhost:3000' + fullPath) + '&response_type=code&state=' + JSON.stringify(to.query) //本地
// window.location.href = 'https://signin.nio.com/oauth2/authorize?client_id=100679&redirect_uri='
// + encodeURIComponent('http://grp.nioint.com' + fullPath) + '&response_type=code&state=' + JSON.stringify(to.query) //线上
NProgress.done() // if current page is login will not trigger afterEach hook, so manually handle it NProgress.done() // if current page is login will not trigger afterEach hook, so manually handle it
} }
} }