refactor(admin): clean up audit/permission/paid content config
- P1: remove the duplicate "审核联动" (ai_moderate_background/submit) block from the attachment permissions page; those settings live in the "评论审核" / API content audit surfaces. - P2: rename the "内容审核" submenu to "评论审核" (permissions domain). - P4: remove the "下载/付费内容中心" page and its schema/route chain; hardcode runtime policy so download always supports credit purchase and paid content is limited to posts. Drop the now-dead cms_features.download_credit flag and parse_slug_list helper.
This commit is contained in:
1 parent
2f4ce790a7
commit
b4a4b295bc
16 files changed
+33
-461
No files matched your search
@@ -70,28 +70,6 @@
|
||||
</n-form>
|
||||
</n-card>
|
||||
|
||||
<!-- AI Moderation -->
|
||||
<n-card class="aksrt-section-card">
|
||||
<div class="aksrt-section-header">
|
||||
<h3>审核联动</h3>
|
||||
</div>
|
||||
<n-form :model="form" label-placement="left" label-width="200" class="aksrt-form">
|
||||
<n-form-item label="背景图接入 AI 审核">
|
||||
<n-switch v-model:value="form.ai_moderate_background" />
|
||||
<template #feedback>
|
||||
<span class="aksrt-hint-text">命中高风险时会阻断上传,并保留上一次背景图。</span>
|
||||
</template>
|
||||
</n-form-item>
|
||||
|
||||
<n-form-item label="投稿图片接入 AI 审核">
|
||||
<n-switch v-model:value="form.ai_moderate_submit" />
|
||||
<template #feedback>
|
||||
<span class="aksrt-hint-text">投稿中插入的图片也会经过内容安全审核。</span>
|
||||
</template>
|
||||
</n-form-item>
|
||||
</n-form>
|
||||
</n-card>
|
||||
|
||||
<div class="aksrt-form-actions">
|
||||
<n-button type="primary" :loading="saving" @click="handleSave">保存配置</n-button>
|
||||
</div>
|
||||
@@ -112,15 +90,12 @@ const message = useMessage()
|
||||
|
||||
const loading = ref(true)
|
||||
const saving = ref(false)
|
||||
const moderationSnapshot = ref({})
|
||||
|
||||
const form = reactive({
|
||||
avatar_max_size: 2,
|
||||
submit_image_max_size: 5,
|
||||
comment_image_max_size: 2,
|
||||
resource_max_size: 50,
|
||||
ai_moderate_background: true,
|
||||
ai_moderate_submit: false,
|
||||
})
|
||||
|
||||
const summaryItems = computed(() => [
|
||||
@@ -139,24 +114,15 @@ function goModeration() { router.push('/permissions/moderation') }
|
||||
async function load() {
|
||||
loading.value = true
|
||||
try {
|
||||
const [permissionRes, moderationRes] = await Promise.all([
|
||||
api.getPermissionsAttachmentSettings(),
|
||||
api.getPermissionsModerationSettings(),
|
||||
])
|
||||
const permissionRes = await api.getPermissionsAttachmentSettings()
|
||||
|
||||
const permission = permissionRes?.data ?? permissionRes ?? {}
|
||||
const moderation = moderationRes?.data ?? moderationRes ?? {}
|
||||
|
||||
// Map permission fields
|
||||
form.avatar_max_size = Number(permission.avatar_max_size || 2)
|
||||
form.submit_image_max_size = Number(permission.submit_image_max_size || 5)
|
||||
form.comment_image_max_size = Number(permission.comment_image_max_size || 2)
|
||||
form.resource_max_size = Number(permission.resource_max_size || 50)
|
||||
|
||||
form.ai_moderate_background = moderation.ai_moderate_background !== false
|
||||
form.ai_moderate_submit = !!moderation.ai_moderate_submit
|
||||
|
||||
moderationSnapshot.value = { ...moderation }
|
||||
} catch (error) {
|
||||
message.error(error.message || '加载附件权限失败')
|
||||
} finally {
|
||||
@@ -167,24 +133,12 @@ async function load() {
|
||||
async function handleSave() {
|
||||
saving.value = true
|
||||
try {
|
||||
await Promise.all([
|
||||
api.savePermissionsAttachmentSettings({
|
||||
avatar_max_size: form.avatar_max_size,
|
||||
submit_image_max_size: form.submit_image_max_size,
|
||||
comment_image_max_size: form.comment_image_max_size,
|
||||
resource_max_size: form.resource_max_size,
|
||||
}),
|
||||
api.savePermissionsModerationSettings({
|
||||
...moderationSnapshot.value,
|
||||
ai_moderate_background: form.ai_moderate_background,
|
||||
ai_moderate_submit: form.ai_moderate_submit,
|
||||
}),
|
||||
])
|
||||
moderationSnapshot.value = {
|
||||
...moderationSnapshot.value,
|
||||
ai_moderate_background: form.ai_moderate_background,
|
||||
ai_moderate_submit: form.ai_moderate_submit,
|
||||
}
|
||||
await api.savePermissionsAttachmentSettings({
|
||||
avatar_max_size: form.avatar_max_size,
|
||||
submit_image_max_size: form.submit_image_max_size,
|
||||
comment_image_max_size: form.comment_image_max_size,
|
||||
resource_max_size: form.resource_max_size,
|
||||
})
|
||||
message.success('附件治理配置已保存')
|
||||
} catch (error) {
|
||||
message.error(error.message || '保存失败')
|
||||
|
||||
Reference in new issue
Block a user