Merge branch 'master' into 'main'
fix: 修复oneid登录,登录失败,自动进入手动登录界面 See merge request cs-psm-dig/siemens.emp.ui!2
This commit is contained in:
commit
f6c8b6b3cb
|
@ -74,6 +74,7 @@ router.beforeEach(async(to, from, next) => {
|
||||||
} else {
|
} else {
|
||||||
window.location.href = 'https://api.oneid.siemens.com.cn/api/bff/v1.2/developer/ciam/oauth/authorize?client_id=1b867769c8cb221fb7fdb0f8beba6138TwXkI4mX8um&response_type=code&redirect_uri=http://csdc.siemens.com.cn:8001/callback&scope=openid%20phone'
|
window.location.href = 'https://api.oneid.siemens.com.cn/api/bff/v1.2/developer/ciam/oauth/authorize?client_id=1b867769c8cb221fb7fdb0f8beba6138TwXkI4mX8um&response_type=code&redirect_uri=http://csdc.siemens.com.cn:8001/callback&scope=openid%20phone'
|
||||||
// window.location.href = 'https://api.oneid.siemens.com.cn/api/bff/v1.2/developer/ciam/oauth/authorize?client_id=1b867769c8cb221fb7fdb0f8beba6138TwXkI4mX8um&response_type=code&redirect_uri=http://localhost:9528/callback&scope=openid%20phone'
|
// window.location.href = 'https://api.oneid.siemens.com.cn/api/bff/v1.2/developer/ciam/oauth/authorize?client_id=1b867769c8cb221fb7fdb0f8beba6138TwXkI4mX8um&response_type=code&redirect_uri=http://localhost:9528/callback&scope=openid%20phone'
|
||||||
|
// window.location.href = 'https://api.oneid.siemens.com.cn/api/bff/v1.2/developer/ciam/oauth/authorize?client_id=1b867769c8cb221fb7fdb0f8beba6138TwXkI4mX8um&response_type=code&redirect_uri=https://cs-vsc.siemens.com.cn:444/callback&scope=openid%20phone'
|
||||||
}
|
}
|
||||||
NProgress.done()
|
NProgress.done()
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,13 +26,18 @@ export default {
|
||||||
// 发送 code 给后端进行验证和处理
|
// 发送 code 给后端进行验证和处理
|
||||||
const response = await getOneIdToken(code)
|
const response = await getOneIdToken(code)
|
||||||
if (response) {
|
if (response) {
|
||||||
console.log('response.Token:' + response.data.token)
|
console.log('🐱one自动登录接口状态:', response.code)
|
||||||
// 存token
|
if (response.code === 200) {
|
||||||
this.$store.dispatch('user/commitToken', response.data.token)
|
console.log('response.Token:' + response.data.token)
|
||||||
// 重新加载路由 这里不对
|
// 存token
|
||||||
// resetRouter() 这个没用,还把你的路由破坏了
|
this.$store.dispatch('user/commitToken', response.data.token)
|
||||||
// console.log(this.$store.state.user, this.$store.state.token)
|
// 重新加载路由 这里不对
|
||||||
this.$router.push({ path: '/nav' })
|
// resetRouter() 这个没用,还把你的路由破坏了
|
||||||
|
// console.log(this.$store.state.user, this.$store.state.token)
|
||||||
|
this.$router.push({ path: '/nav' })
|
||||||
|
} else {
|
||||||
|
this.$router.push({ path: '/login' })
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log('No token found with code')
|
console.log('No token found with code')
|
||||||
window.location.href = 'https://api.oneid.siemens.com.cn/api/bff/v1.2/developer/ciam/oauth/authorize?client_id=1b867769c8cb221fb7fdb0f8beba6138TwXkI4mX8um&response_type=code&redirect_uri=http://csdc.siemens.com.cn:8001/callback&scope=openid%20phone'
|
window.location.href = 'https://api.oneid.siemens.com.cn/api/bff/v1.2/developer/ciam/oauth/authorize?client_id=1b867769c8cb221fb7fdb0f8beba6138TwXkI4mX8um&response_type=code&redirect_uri=http://csdc.siemens.com.cn:8001/callback&scope=openid%20phone'
|
||||||
|
|
|
@ -40,7 +40,7 @@ module.exports = {
|
||||||
[process.env.VUE_APP_BASE_API]: {
|
[process.env.VUE_APP_BASE_API]: {
|
||||||
target: 'http://139.219.4.195:8003',
|
target: 'http://139.219.4.195:8003',
|
||||||
// 测试地址
|
// 测试地址
|
||||||
// target: 'http://192.168.1.169:8003',
|
// target: 'http://192.168.237.154:8003',
|
||||||
pathRewrite: {
|
pathRewrite: {
|
||||||
['^' + process.env.VUE_APP_BASE_API]: ''
|
['^' + process.env.VUE_APP_BASE_API]: ''
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue