feat(risk-control): add content moderation audit
This commit is contained in:
@@ -505,6 +505,19 @@ const routes: RouteRecordRaw[] = [
|
||||
descriptionKey: 'admin.settings.description'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/admin/risk-control',
|
||||
name: 'AdminRiskControl',
|
||||
component: () => import('@/views/admin/RiskControlView.vue'),
|
||||
meta: {
|
||||
requiresAuth: true,
|
||||
requiresAdmin: true,
|
||||
title: 'Risk Control',
|
||||
titleKey: 'admin.riskControl.title',
|
||||
descriptionKey: 'admin.riskControl.description',
|
||||
requiresRiskControl: true
|
||||
}
|
||||
},
|
||||
{
|
||||
path: '/admin/usage',
|
||||
name: 'AdminUsage',
|
||||
@@ -747,6 +760,14 @@ router.beforeEach((to, _from, next) => {
|
||||
}
|
||||
}
|
||||
|
||||
if (to.meta.requiresRiskControl) {
|
||||
const riskControlEnabled = appStore.cachedPublicSettings?.risk_control_enabled === true
|
||||
if (!riskControlEnabled) {
|
||||
next(authStore.isAdmin ? '/admin/settings' : '/dashboard')
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// 简易模式下限制访问某些页面
|
||||
if (authStore.isSimpleMode) {
|
||||
const restrictedPaths = [
|
||||
|
||||
6
frontend/src/router/meta.d.ts
vendored
6
frontend/src/router/meta.d.ts
vendored
@@ -49,6 +49,12 @@ declare module 'vue-router' {
|
||||
*/
|
||||
requiresPayment?: boolean
|
||||
|
||||
/**
|
||||
* 是否要求风控中心功能开关已启用
|
||||
* @default false
|
||||
*/
|
||||
requiresRiskControl?: boolean
|
||||
|
||||
/**
|
||||
* i18n key for the page title
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user