feat(auth): 新增合作伙伴 token 认证接口
This commit is contained in:
7
app.vue
7
app.vue
@@ -18,8 +18,9 @@ useSeoMeta({
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
loginState.checkSession().then(async (res) => {
|
||||
if (!res && loginState.token) {
|
||||
loginState.checkSession().then(async (loggedIn) => {
|
||||
if (route.meta.preventLoginCheck) return
|
||||
if (!loggedIn && loginState.token) {
|
||||
toast.add({
|
||||
title: '登录失效',
|
||||
description: '登录已过期,请重新登录',
|
||||
@@ -27,7 +28,7 @@ onMounted(() => {
|
||||
icon: 'i-tabler-alert-triangle',
|
||||
})
|
||||
modal.open(ModalAuthentication)
|
||||
} else if (!res && !loginState.token) {
|
||||
} else if (!loggedIn && !loginState.token) {
|
||||
// Prevents redirect from register page
|
||||
if (route.path === '/user/register') return
|
||||
router.replace('/user/authenticate')
|
||||
|
||||
Reference in New Issue
Block a user