[update 单点登录] 测试飞书单点登录
This commit is contained in:
@@ -92,12 +92,6 @@ function main () {
|
||||
store.commit('TOGGLE_COLOR', Vue.ls.get(DEFAULT_COLOR, config.primaryColor))
|
||||
store.commit('SET_TOKEN', Vue.ls.get(ACCESS_TOKEN))
|
||||
store.commit('SET_MULTI_PAGE', Vue.ls.get(DEFAULT_MULTI_PAGE, config.multipage))
|
||||
// 如果没有登录,state是飞书,并且有code,就请求飞书单点登录
|
||||
if (!Vue.ls.get(ACCESS_TOKEN) && this.$route.query.code && this.$route.query.state === 'feishu') {
|
||||
store.dispatch('FeiShuLogin').catch((e) => {
|
||||
this.$message.warn(e.message)
|
||||
})
|
||||
}
|
||||
},
|
||||
render: h => h(App),
|
||||
data: {
|
||||
|
||||
@@ -35,6 +35,11 @@ router.beforeEach(async (to, from, next) => {
|
||||
store.commit('SET_NAME', { username: userInfo.username, realname: userInfo.realname, welcome: welcome() })
|
||||
store.commit('SET_AVATAR', userInfo.avatar)
|
||||
}
|
||||
} else if (!Vue.ls.get(ACCESS_TOKEN) && to.query.code && to.query.state === 'feishu') {
|
||||
// 如果没有登录,state是飞书,并且有code,就请求飞书单点登录
|
||||
store.dispatch('FeiShuLogin').catch((e) => {
|
||||
this.$message.warn(e.message)
|
||||
})
|
||||
} else if (to.query.code) {
|
||||
// 研发大前台单点登录
|
||||
const { result, success, message } = await getSSOUserInfo({ code: to.query.code })
|
||||
|
||||
Reference in New Issue
Block a user