[update 飞书单点登录] 解决流程办理完go(-1)会跳转中转路由

This commit is contained in:
danshihao
2024-08-05 17:05:42 +08:00
parent 076e178f11
commit 1803fd2432
+5 -1
View File
@@ -37,7 +37,11 @@ router.beforeEach(async (to, from, next) => {
} else if (to.query.code && to.query.state === 'feishu') {
// 如果没有登录,state是飞书,并且有code,就请求飞书单点登录
await store.dispatch('FeiShuLogin', to.query.code).catch((e) => {
this.$message.warn(e.message)
// 从飞书跳转进来,正常提示,系统内跳转进来不提示(解决用了replace,但是go(-1)还会跳转回来)
if (from.path === '/') {
Vue.prototype.$message.warning(e.message, 3)
}
next({ path: '/user/login', replace: true })
})
} else if (to.query.code) {
// 研发大前台单点登录