完善系统接入诊断与审核状态展示
This commit is contained in:
@@ -9,11 +9,19 @@
|
||||
</header>
|
||||
|
||||
<a-alert
|
||||
type="warning"
|
||||
:type="moderationNotice.type"
|
||||
show-icon
|
||||
message="内容审核当前为本地模拟流程,不会调用微信内容安全接口。正式上线前需接入审核服务并复核隐私指引。"
|
||||
:message="moderationNotice.title"
|
||||
:description="moderationNotice.description"
|
||||
class="page-notice"
|
||||
/>
|
||||
>
|
||||
<template #action>
|
||||
<a-space>
|
||||
<a-button v-if="integrationStatusError" size="small" @click="loadIntegrationStatus">重试</a-button>
|
||||
<a-button size="small" @click="openIntegrationSettings">服务接入设置</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
</a-alert>
|
||||
|
||||
<a-tabs v-model:active-key="activeTab" @change="loadActiveTab">
|
||||
<a-tab-pane key="closures">
|
||||
@@ -74,7 +82,7 @@
|
||||
</a-space>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else-if="column.key === 'status'">{{ record.status === 'RETRY' ? '待复核(模拟服务故障)' : '待复核' }}</template>
|
||||
<template v-else-if="column.key === 'status'">{{ record.status === 'RETRY' ? '待复核(审核服务暂不可用)' : '待复核' }}</template>
|
||||
<template v-else-if="column.key === 'action'">
|
||||
<a-space>
|
||||
<a-button type="link" @click="openModeration(record as ContentModerationRecordVO, true)">通过</a-button>
|
||||
@@ -122,21 +130,26 @@
|
||||
|
||||
<a-modal v-model:open="moderationOpen" :title="moderationApproved ? '通过内容复核' : '拒绝内容'" :confirm-loading="actionLoading" :mask-closable="false" @ok="submitModeration">
|
||||
<p v-if="moderationTarget">{{ moderationType(moderationTarget.contentType) }}内容,记录号 {{ moderationTarget.id }}</p>
|
||||
<a-form-item label="复核说明"><a-textarea v-model:value="moderationReason" :rows="3" placeholder="说明本次模拟复核结果" /></a-form-item>
|
||||
<p class="moderation-provider-context">{{ moderationReviewContext }}</p>
|
||||
<a-form-item label="复核说明"><a-textarea v-model:value="moderationReason" :rows="3" :placeholder="moderationApproved ? '说明本次复核通过原因' : '说明本次拒绝原因'" /></a-form-item>
|
||||
</a-modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, onActivated, onMounted, ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { message, Modal } from 'ant-design-vue'
|
||||
import { buildModerationNotice } from '@/utils/moderation-status'
|
||||
import {
|
||||
adminPrivacyComplianceApi,
|
||||
type AccountClosureRequestVO,
|
||||
type ClosureSuccessorManagerVO,
|
||||
type ContentModerationRecordVO,
|
||||
type PhoneBackfillReportVO
|
||||
type PhoneBackfillReportVO,
|
||||
type SecureIntegrationConfigVO
|
||||
} from '@/api/admin'
|
||||
import { adminSecureIntegrationConfigApi } from '@/api/admin'
|
||||
|
||||
const activeTab = ref('closures')
|
||||
const closures = ref<AccountClosureRequestVO[]>([])
|
||||
@@ -157,6 +170,15 @@ const moderationOpen = ref(false)
|
||||
const moderationTarget = ref<ContentModerationRecordVO | null>(null)
|
||||
const moderationApproved = ref(false)
|
||||
const moderationReason = ref('')
|
||||
const secureIntegration = ref<SecureIntegrationConfigVO | null>(null)
|
||||
const integrationStatusError = ref(false)
|
||||
const router = useRouter()
|
||||
const moderationNotice = computed(() => buildModerationNotice(secureIntegration.value, integrationStatusError.value))
|
||||
const moderationReviewContext = computed(() => {
|
||||
if (secureIntegration.value?.moderationProvider === 'WECHAT' && secureIntegration.value.moderationReady) return '当前环境使用微信内容审核;此处用于处理微信要求人工复核或审核服务异常的记录。'
|
||||
if (secureIntegration.value?.moderationProvider === 'MOCK' && secureIntegration.value.mockProviderAllowed) return '当前环境允许本地模拟审核;此操作不会调用微信内容安全接口。'
|
||||
return '请依据内容和平台审核规范填写复核说明;审核渠道不可用时,内容仍保持隔离。'
|
||||
})
|
||||
const hasBackfillConflicts = computed(() => Boolean(backfillReport.value?.accountConflictRows || backfillReport.value?.phoneConflictRows))
|
||||
const successorOptions = computed(() => successorManagers.value.map(manager => ({ label: `${manager.nickname || '店长'}(${manager.id})`, value: manager.id })))
|
||||
|
||||
@@ -197,6 +219,16 @@ async function loadModeration() {
|
||||
finally { moderationLoading.value = false }
|
||||
}
|
||||
|
||||
async function loadIntegrationStatus() {
|
||||
integrationStatusError.value = false
|
||||
try { secureIntegration.value = await adminSecureIntegrationConfigApi.getConfig() }
|
||||
catch (error) { integrationStatusError.value = true; message.error(error instanceof Error ? error.message : '读取内容审核状态失败') }
|
||||
}
|
||||
|
||||
function openIntegrationSettings() {
|
||||
void router.push({ path: '/admin/settings', query: { section: 'services' } })
|
||||
}
|
||||
|
||||
function loadActiveTab() {
|
||||
if (activeTab.value === 'closures') void loadClosures()
|
||||
if (activeTab.value === 'moderation') void loadModeration()
|
||||
@@ -253,7 +285,9 @@ function confirmArchive() {
|
||||
function openModeration(record: ContentModerationRecordVO, approved: boolean) {
|
||||
moderationTarget.value = record
|
||||
moderationApproved.value = approved
|
||||
moderationReason.value = approved ? '本地模拟复核通过。' : ''
|
||||
moderationReason.value = approved
|
||||
? secureIntegration.value?.moderationProvider === 'MOCK' && secureIntegration.value.mockProviderAllowed ? '本地模拟复核通过。' : '经管理员复核,内容符合平台规范。'
|
||||
: ''
|
||||
moderationOpen.value = true
|
||||
}
|
||||
|
||||
@@ -305,6 +339,7 @@ let skipInitialActivationRefresh = true
|
||||
onMounted(() => {
|
||||
void loadClosures()
|
||||
void loadModeration()
|
||||
void loadIntegrationStatus()
|
||||
})
|
||||
onActivated(() => {
|
||||
if (skipInitialActivationRefresh) {
|
||||
@@ -313,6 +348,7 @@ onActivated(() => {
|
||||
}
|
||||
void loadClosures()
|
||||
void loadModeration()
|
||||
void loadIntegrationStatus()
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -325,6 +361,7 @@ onActivated(() => {
|
||||
.payload-preview { max-width: 420px; max-height: 180px; margin: 0; overflow: auto; white-space: pre-wrap; word-break: break-word; font-size: 12px; }
|
||||
.moderation-content { display: grid; gap: 6px; }
|
||||
.moderation-author { color: var(--ant-color-text-secondary); font-size: 12px; }
|
||||
.moderation-provider-context { color: var(--ant-color-text-secondary); font-size: 12px; line-height: 1.55; }
|
||||
.image-pending { color: var(--ant-color-text-secondary); font-size: 12px; }
|
||||
.backfill-panel { width: 100%; padding: 8px 0; }
|
||||
.closure-shops { display: grid; gap: 12px; margin-bottom: 16px; }
|
||||
|
||||
Reference in New Issue
Block a user