单点修改
This commit is contained in:
@@ -9,7 +9,7 @@ import { useDictStoreWithOut } from '@/store/modules/dict'
|
||||
import { useUserStoreWithOut } from '@/store/modules/user'
|
||||
import { useLowStoreWithOut } from '@/store/modules/low'
|
||||
import { usePermissionStoreWithOut } from '@/store/modules/permission'
|
||||
|
||||
import * as authUtil from '@/utils/auth'
|
||||
const { start, done } = useNProgress()
|
||||
|
||||
const { loadStart, loadDone } = usePageLoading()
|
||||
@@ -63,7 +63,24 @@ router.beforeEach(async (to, from, next) => {
|
||||
loadStart()
|
||||
if (getAccessToken()) {
|
||||
if (to.path === '/login') {
|
||||
next({ path: '/' })
|
||||
const queryParams = new URLSearchParams(window.location.search);
|
||||
const ticketUrl = queryParams.get('url');
|
||||
const ssUrl = queryParams.get('ssUrl');
|
||||
|
||||
if(ticketUrl!=null&&ssUrl==null){
|
||||
next()
|
||||
}else if(ticketUrl!=null&&ssUrl!==null){
|
||||
const accessToken =authUtil.getAccessToken();
|
||||
if(accessToken!=null){
|
||||
const urll=ticketUrl+"?ticket="+accessToken;
|
||||
window.location.href = urll+(ssUrl?"&redirect="+ssUrl:'');
|
||||
}else{
|
||||
next({ path: '/' })
|
||||
}
|
||||
}else{
|
||||
next({ path: '/' })
|
||||
}
|
||||
|
||||
} else {
|
||||
// 获取所有字典
|
||||
const dictStore = useDictStoreWithOut()
|
||||
|
||||
Reference in New Issue
Block a user