|
@@ -20,17 +20,19 @@ const routes = [
|
|
name: 'login',
|
|
name: 'login',
|
|
path: '/login',
|
|
path: '/login',
|
|
component: () => import('@/views/global/login/index.vue'),
|
|
component: () => import('@/views/global/login/index.vue'),
|
|
- meta: {
|
|
|
|
- noLoading: true,
|
|
|
|
- },
|
|
|
|
|
|
+ meta: {},
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ name: 'invite',
|
|
|
|
+ path: '/invite',
|
|
|
|
+ component: () => import('@/views/global/invite/index.vue'),
|
|
|
|
+ meta: {},
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: 'workflow',
|
|
name: 'workflow',
|
|
path: '/workflow',
|
|
path: '/workflow',
|
|
component: () => import('@/views/workflow/index.vue'),
|
|
component: () => import('@/views/workflow/index.vue'),
|
|
- meta: {
|
|
|
|
- noLoading: true,
|
|
|
|
- },
|
|
|
|
|
|
+ meta: {},
|
|
},
|
|
},
|
|
]
|
|
]
|
|
const hasLogin = (import.meta as any).env.VITE_LOGIN_MUST === 'Y'
|
|
const hasLogin = (import.meta as any).env.VITE_LOGIN_MUST === 'Y'
|
|
@@ -41,6 +43,7 @@ const router = createRouter({
|
|
})
|
|
})
|
|
router.beforeEach((to, from, next) => {
|
|
router.beforeEach((to, from, next) => {
|
|
const isLogin = to.name === 'login'
|
|
const isLogin = to.name === 'login'
|
|
|
|
+ const inviteQuery = to.name === 'invite' ? to.query : {}
|
|
const AppStore = useAppStore()
|
|
const AppStore = useAppStore()
|
|
AppStore.loadingStart()
|
|
AppStore.loadingStart()
|
|
if (
|
|
if (
|
|
@@ -63,13 +66,13 @@ router.beforeEach((to, from, next) => {
|
|
})
|
|
})
|
|
.catch((e) => {
|
|
.catch((e) => {
|
|
localStorage.removeItem((import.meta as any).env.VITE_TOKEN)
|
|
localStorage.removeItem((import.meta as any).env.VITE_TOKEN)
|
|
- next({ name: 'login' })
|
|
|
|
|
|
+ next({ name: 'login', query: inviteQuery })
|
|
})
|
|
})
|
|
.finally(() => {
|
|
.finally(() => {
|
|
AppStore.loadingEnd()
|
|
AppStore.loadingEnd()
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
- next({ name: 'login' })
|
|
|
|
|
|
+ next({ name: 'login', query: inviteQuery })
|
|
AppStore.loadingEnd()
|
|
AppStore.loadingEnd()
|
|
}
|
|
}
|
|
}
|
|
}
|