feat: complete admin API integration
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
||||
Menu,
|
||||
} from '@lucide/vue'
|
||||
import { PRODUCT_NAME } from '@chongchong/shared'
|
||||
import { getApiErrorDetails } from '@/api/http'
|
||||
import AdminSidebarMenu from '@/components/AdminSidebarMenu.vue'
|
||||
import RolePreviewSwitcher from '@/components/RolePreviewSwitcher.vue'
|
||||
import { resolvePreviewTarget } from '@/router/accessDecision'
|
||||
@@ -169,7 +170,13 @@ async function handleLogout() {
|
||||
loggingOut.value = true
|
||||
access.reset()
|
||||
unsaved.clear()
|
||||
auth.logout()
|
||||
try {
|
||||
await auth.logout()
|
||||
} catch (error) {
|
||||
const details = getApiErrorDetails(error, '服务器会话撤销失败')
|
||||
const trackingId = details.requestId || details.traceId
|
||||
ElMessage.warning(`本地已退出,但服务器会话撤销失败${trackingId ? `(追踪标识:${trackingId})` : ''}`)
|
||||
}
|
||||
try {
|
||||
await router.replace('/login')
|
||||
} catch {
|
||||
|
||||
Reference in New Issue
Block a user