check cookie redirect sso
This commit is contained in:
parent
3806ce6843
commit
28ff743911
1 changed files with 2 additions and 2 deletions
|
|
@ -4,7 +4,7 @@ import MapView from '@/views/MapView.vue'
|
||||||
import MainView from '@/views/MainView.vue'
|
import MainView from '@/views/MainView.vue'
|
||||||
const loginView = () => import('@/views/login.vue')
|
const loginView = () => import('@/views/login.vue')
|
||||||
|
|
||||||
import { authenticated } from '@/plugins/auth'
|
import { authenticated, logout } from '@/plugins/auth'
|
||||||
|
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
history: createWebHistory(import.meta.env.BASE_URL),
|
history: createWebHistory(import.meta.env.BASE_URL),
|
||||||
|
|
@ -85,7 +85,7 @@ router.beforeEach(async (to, from, next) => {
|
||||||
if (to.meta.Auth) {
|
if (to.meta.Auth) {
|
||||||
const checkAuthen = await authenticated()
|
const checkAuthen = await authenticated()
|
||||||
if (!checkAuthen && to.meta.Auth) {
|
if (!checkAuthen && to.meta.Auth) {
|
||||||
router.push({ name: 'loginMain' })
|
logout()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
next()
|
next()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue