fix: 修复代理生成卡密权限检查和参数问题

- 后端兼容application_id和app_id参数
- 添加卡类权限检查,确保代理只能生成有权限的卡类
- 前端使用application_id参数名
- 移除卡类显示中的billing_type原始值,改为显示价格

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-10 01:16:28 +08:00
parent e63753a853
commit a2ce784ac0
2 changed files with 32 additions and 4 deletions
+2 -2
View File
@@ -104,7 +104,7 @@ async function handleGenerate() {
saving.value = true
try {
const data = await api.post<{ codes: string[], cards: any[] }>('/agent/cards/generate', {
app_id: Number(form.value.application_id),
application_id: Number(form.value.application_id),
card_type_id: Number(form.value.card_type_id),
quantity: form.value.count,
})
@@ -178,7 +178,7 @@ onMounted(() => {
</UiSelectTrigger>
<UiSelectContent>
<UiSelectItem v-for="type in cardTypes" :key="type.id" :value="String(type.id)">
{{ type.name }}<template v-if="type.billing_type"> ({{ type.billing_type }})</template>
{{ type.name }} - ¥{{ type.price }}
</UiSelectItem>
</UiSelectContent>
</UiSelect>