feat(auth): 新增合作伙伴 token 认证接口

This commit is contained in:
2025-09-03 11:02:48 +08:00
parent af11cd5627
commit 721e07e381
2 changed files with 44 additions and 6 deletions

View File

@@ -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')