[update 飞书中转路由] 单点登录后中转路由重定向到要跳转的页面

This commit is contained in:
danshihao
2024-07-30 15:00:51 +08:00
parent c8892cd78d
commit 8790c9ffeb
+11 -2
View File
@@ -6,7 +6,6 @@ import 'nprogress/nprogress.css' // progress bar style
import { ACCESS_TOKEN, OAUTH2_LOGIN_PAGE_PATH, UI_CACHE_DB_DICT_DATA, USER_INFO, USER_NAME } from '@/store/mutation-types'
import { generateIndexRouter, isOAuth2AppEnv, findFirstRoute, welcome } from '@/utils/util'
import { getSSOUserInfo, getTodoSSOUserInfo } from './api/api'
import { isCanLookDetail } from './api/enterpriseStandardLibraryApi'
import { updatePageHeight } from './components/tools/setting'
NProgress.configure({ showSpinner: false }) // NProgress Configuration
@@ -72,7 +71,17 @@ router.beforeEach(async (to, from, next) => {
NProgress.start() // start progress bar
if (Vue.ls.get(ACCESS_TOKEN)) {
/* has token */
if (to.path === '/user/login' || to.path === OAUTH2_LOGIN_PAGE_PATH) {
// 飞书中转路径
if (to.path === '/transferRedirectPage') {
// 去掉重定向的参数,然后跳转对应页面
const query = Object.assign({}, to.query)
delete query.finalRedirectPage
next({
path: to.query.finalRedirectPage,
replace: true,
query
})
} else if (to.path === '/user/login' || to.path === OAUTH2_LOGIN_PAGE_PATH) {
store.dispatch('GetPermissionList').then(res => {
const menuData = res.result.menu
if (menuData === null || menuData === '' || menuData === undefined) {