修复管理员卡密管理页面统计数据显示不准确
This commit is contained in:
@@ -59,9 +59,9 @@ const filteredCardTypes = computed(() => {
|
||||
return cardTypes.value
|
||||
})
|
||||
|
||||
const unusedCount = computed(() => cards.value.filter(card => card.status === 'unused').length)
|
||||
const usedCount = computed(() => cards.value.filter(card => card.status === 'used').length)
|
||||
const bannedCount = computed(() => cards.value.filter(card => card.status === 'banned').length)
|
||||
const unusedCount = ref(0)
|
||||
const usedCount = ref(0)
|
||||
const bannedCount = ref(0)
|
||||
|
||||
const applicationOptions = computed(() => {
|
||||
return applications.value.map(app => ({
|
||||
@@ -132,9 +132,12 @@ async function fetchCards() {
|
||||
params.append('search', searchFilter.value.trim())
|
||||
}
|
||||
|
||||
const data = await api.get<{ cards: Card[], total: number }>(`/dev/cards?${params.toString()}`)
|
||||
const data = await api.get<any>(`/dev/cards?${params.toString()}`)
|
||||
cards.value = data?.cards || []
|
||||
total.value = data?.total || 0
|
||||
unusedCount.value = data?.unused_count || 0
|
||||
usedCount.value = data?.used_count || 0
|
||||
bannedCount.value = data?.banned_count || 0
|
||||
}
|
||||
catch (error) {
|
||||
console.error('获取卡密列表失败:', error)
|
||||
|
||||
Reference in New Issue
Block a user