完成授权页面样式重设计、云端数据权限功能、修复代理后台页面问题

This commit is contained in:
2026-05-09 09:21:48 +08:00
parent 0bd52e6bf1
commit 17d7d4c68d
13 changed files with 975 additions and 417 deletions
+16 -3
View File
@@ -23,11 +23,20 @@ const cards = ref<Card[]>([])
onMounted(async () => {
try {
const data = await api.get<Card[]>('/agent/cards')
cards.value = data || []
const data = await api.get<any>('/agent/cards')
if (Array.isArray(data)) {
cards.value = data
} else if (data?.cards) {
cards.value = data.cards
} else if (data?.data) {
cards.value = Array.isArray(data.data) ? data.data : []
} else {
cards.value = []
}
}
catch (error) {
console.error('Load cards failed:', error)
cards.value = []
}
finally {
loading.value = false
@@ -55,6 +64,10 @@ function getStatusBadge(status: string) {
<BasicPage
:title="t('nav.cards')"
description="管理生成的卡密"
:breadcrumbs="[
{ title: '控制台', href: '/agent' },
{ title: '卡密管理' },
]"
sticky
>
<template #actions>
@@ -107,7 +120,7 @@ function getStatusBadge(status: string) {
</tr>
</thead>
<tbody class="divide-y">
<tr v-for="card in cards" :key="card.id" class="hover:bg-muted/30">
<tr v-for="card in cards.filter(c => c)" :key="card.id" class="hover:bg-muted/30">
<td class="px-4 py-3 font-mono text-sm">
{{ card.code }}
</td>