[update 飞书中转路由] 单点登录后中转路由重定向到要跳转的页面
This commit is contained in:
+11
-2
@@ -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 { 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 { generateIndexRouter, isOAuth2AppEnv, findFirstRoute, welcome } from '@/utils/util'
|
||||||
import { getSSOUserInfo, getTodoSSOUserInfo } from './api/api'
|
import { getSSOUserInfo, getTodoSSOUserInfo } from './api/api'
|
||||||
import { isCanLookDetail } from './api/enterpriseStandardLibraryApi'
|
|
||||||
import { updatePageHeight } from './components/tools/setting'
|
import { updatePageHeight } from './components/tools/setting'
|
||||||
|
|
||||||
NProgress.configure({ showSpinner: false }) // NProgress Configuration
|
NProgress.configure({ showSpinner: false }) // NProgress Configuration
|
||||||
@@ -72,7 +71,17 @@ router.beforeEach(async (to, from, next) => {
|
|||||||
NProgress.start() // start progress bar
|
NProgress.start() // start progress bar
|
||||||
if (Vue.ls.get(ACCESS_TOKEN)) {
|
if (Vue.ls.get(ACCESS_TOKEN)) {
|
||||||
/* has 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 => {
|
store.dispatch('GetPermissionList').then(res => {
|
||||||
const menuData = res.result.menu
|
const menuData = res.result.menu
|
||||||
if (menuData === null || menuData === '' || menuData === undefined) {
|
if (menuData === null || menuData === '' || menuData === undefined) {
|
||||||
|
|||||||
Reference in New Issue
Block a user