|
@@ -1438,6 +1438,65 @@ function renderAdminSystemConfigModule() {
|
|
|
[{label:'配置ID(id)', name:'id', placeholder:'需删除的配置ID', default:''}], true, null, '删除指定ID的系统配置。删除后对应API Key将立即失效')}`;
|
|
[{label:'配置ID(id)', name:'id', placeholder:'需删除的配置ID', default:''}], true, null, '删除指定ID的系统配置。删除后对应API Key将立即失效')}`;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// ==================== 运营端:操作审计日志模块 ====================
|
|
|
|
|
+function renderAdminAuditLogModule() {
|
|
|
|
|
+ return `
|
|
|
|
|
+ <div class="batch-buttons">
|
|
|
|
|
+ <button class="btn btn-warning btn-sm" onclick="runAdminAuditLogTests()">运行操作审计日志测试</button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ ${testSection('admin-audit-log-list', '分页查询操作日志', 'GET', 'get', '/api/admin/audit-log?page={page}&size={size}', '需认证', 'auth-required',
|
|
|
|
|
+ [
|
|
|
|
|
+ {label:'页码(page)', name:'page', placeholder:'1', default:'1'},
|
|
|
|
|
+ {label:'每页(size)', name:'size', placeholder:'20', default:'20'}
|
|
|
|
|
+ ], true, null, '分页查询操作审计日志,默认按操作时间倒序排列')}
|
|
|
|
|
+ ${testSection('admin-audit-log-filter-module', '按模块筛选', 'GET', 'get', '/api/admin/audit-log?module={module}&page={page}&size={size}', '需认证', 'auth-required',
|
|
|
|
|
+ [
|
|
|
|
|
+ {label:'模块(module)', name:'module', placeholder:'USER/LEVEL/PLATFORM/LICENSE/INVITE/COUPON/SYSTEM', default:'LICENSE'},
|
|
|
|
|
+ {label:'页码(page)', name:'page', placeholder:'1', default:'1'},
|
|
|
|
|
+ {label:'每页(size)', name:'size', placeholder:'20', default:'20'}
|
|
|
|
|
+ ], true, null, '按操作模块筛选日志。module可选值:USER-用户管理 / LEVEL-等级配置 / PLATFORM-平台配置 / LICENSE-入驻信息 / INVITE-邀请系统 / COUPON-优惠券 / SYSTEM-系统管理')}
|
|
|
|
|
+ ${testSection('admin-audit-log-filter-type', '按操作类型筛选', 'GET', 'get', '/api/admin/audit-log?operationType={operationType}', '需认证', 'auth-required',
|
|
|
|
|
+ [{label:'操作类型(operationType)', name:'operationType', placeholder:'LICENSE_CREATE/LICENSE_EDIT/LICENSE_REJECT', default:'LICENSE_CREATE'}],
|
|
|
|
|
+ true, null, '按操作类型精确筛选。入驻相关类型:LICENSE_CREATE-新增 / LICENSE_EDIT-编辑 / LICENSE_REJECT-驳回 / LICENSE_APPROVE-审核通过 / LICENSE_RE_REJECT-重新驳回')}
|
|
|
|
|
+ ${testSection('admin-audit-log-filter-source', '按操作来源筛选', 'GET', 'get', '/api/admin/audit-log?operationSource={operationSource}', '需认证', 'auth-required',
|
|
|
|
|
+ [{label:'操作来源(operationSource)', name:'operationSource', placeholder:'ADMIN_CREATE/USER_SUBMIT/EXTERNAL', default:'ADMIN_CREATE'}],
|
|
|
|
|
+ true, null, '按操作来源筛选(第四批新增)。operationSource可选值:ADMIN_CREATE-管理员新增 / USER_SUBMIT-用户自主提交 / EXTERNAL-外部系统。用于区分操作发起来源,便于审计追溯')}
|
|
|
|
|
+ ${testSection('admin-audit-log-filter-operator', '按操作人筛选', 'GET', 'get', '/api/admin/audit-log?operatorId={operatorId}', '需认证', 'auth-required',
|
|
|
|
|
+ [{label:'操作人ID(operatorId)', name:'operatorId', placeholder:'100', default:'100'}],
|
|
|
|
|
+ true, null, '按操作人ID筛选,查看指定管理员或用户的全部操作记录')}
|
|
|
|
|
+ ${testSection('admin-audit-log-filter-sensitive', '筛选敏感操作', 'GET', 'get', '/api/admin/audit-log?isSensitive={isSensitive}', '需认证', 'auth-required',
|
|
|
|
|
+ [{label:'是否敏感(isSensitive)', name:'isSensitive', placeholder:'true/false', default:'true', type:'string'}],
|
|
|
|
|
+ true, null, '筛选敏感操作日志。敏感操作包括:入驻审核、等级变更、权限修改等需要特别关注的操作')}
|
|
|
|
|
+ ${testSection('admin-audit-log-filter-time', '按时间范围筛选', 'GET', 'get', '/api/admin/audit-log?startTime={startTime}&endTime={endTime}', '需认证', 'auth-required',
|
|
|
|
|
+ [
|
|
|
|
|
+ {label:'开始时间(startTime)', name:'startTime', placeholder:'2024-01-01T00:00:00', default:'2024-01-01T00:00:00'},
|
|
|
|
|
+ {label:'结束时间(endTime)', name:'endTime', placeholder:'2030-12-31T23:59:59', default:'2030-12-31T23:59:59'}
|
|
|
|
|
+ ], true, null, '按操作时间范围筛选,ISO 8601格式:yyyy-MM-ddTHH:mm:ss')}
|
|
|
|
|
+ ${testSection('admin-audit-log-multi-filter', '多条件组合筛选', 'GET', 'get', '/api/admin/audit-log?operationSource={operationSource}&module={module}&page={page}&size={size}', '需认证', 'auth-required',
|
|
|
|
|
+ [
|
|
|
|
|
+ {label:'操作来源(operationSource)', name:'operationSource', placeholder:'ADMIN_CREATE', default:'ADMIN_CREATE'},
|
|
|
|
|
+ {label:'模块(module)', name:'module', placeholder:'LICENSE', default:'LICENSE'},
|
|
|
|
|
+ {label:'页码(page)', name:'page', placeholder:'1', default:'1'},
|
|
|
|
|
+ {label:'每页(size)', name:'size', placeholder:'10', default:'10'}
|
|
|
|
|
+ ], true, null, '操作来源与模块组合筛选示例:查看所有管理员发起的入驻相关操作')}
|
|
|
|
|
+ ${testSection('admin-audit-log-sensitive', '查询敏感操作日志', 'GET', 'get', '/api/admin/audit-log/sensitive', '需认证', 'auth-required',
|
|
|
|
|
+ [], true, null, '查询所有敏感操作日志列表(不分页),默认查询全部,可配合startTime参数筛选')}
|
|
|
|
|
+ ${testSection('admin-audit-log-user', '查询用户操作日志', 'GET', 'get', '/api/admin/audit-log/user/{userId}?limit={limit}', '需认证', 'auth-required',
|
|
|
|
|
+ [
|
|
|
|
|
+ {label:'用户ID(userId)', name:'userId', placeholder:'1', default:'1'},
|
|
|
|
|
+ {label:'返回数量(limit)', name:'limit', placeholder:'20', default:'20'}
|
|
|
|
|
+ ], true, null, '查询指定用户的操作日志,按操作时间倒序,limit控制返回条数')}
|
|
|
|
|
+ ${testSection('admin-audit-log-target', '查询目标操作历史', 'GET', 'get', '/api/admin/audit-log/target/{targetType}/{targetId}?limit={limit}', '需认证', 'auth-required',
|
|
|
|
|
+ [
|
|
|
|
|
+ {label:'目标类型(targetType)', name:'targetType', placeholder:'USER/LEVEL_CONFIG/PLATFORM/ACCOUNT/LICENSE', default:'LICENSE'},
|
|
|
|
|
+ {label:'目标ID(targetId)', name:'targetId', placeholder:'1', default:'1'},
|
|
|
|
|
+ {label:'返回数量(limit)', name:'limit', placeholder:'20', default:'20'}
|
|
|
|
|
+ ], true, null, '查询指定目标对象的操作历史。入驻信息审核记录可通过 targetType=LICENSE + targetId=入驻记录ID 查询完整操作链路')}
|
|
|
|
|
+ ${testSection('admin-audit-log-stats', '模块操作统计', 'GET', 'get', '/api/admin/audit-log/stats?module={module}', '需认证', 'auth-required',
|
|
|
|
|
+ [{label:'模块(module)', name:'module', placeholder:'USER/LEVEL/LICENSE', default:'LICENSE'}],
|
|
|
|
|
+ true, null, '统计指定模块的操作次数,可配合startTime/endTime参数按时间范围统计')}`;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
// ===================== 批量测试 ====================
|
|
// ===================== 批量测试 ====================
|
|
|
function getSectionsInModule(modulePrefix) {
|
|
function getSectionsInModule(modulePrefix) {
|
|
|
return Array.from(document.querySelectorAll('.test-section')).filter(s => {
|
|
return Array.from(document.querySelectorAll('.test-section')).filter(s => {
|
|
@@ -1604,6 +1663,7 @@ function runAdminActivityCheckinTests() { runBatchTests('admin-activity-checkin'
|
|
|
function runAdminActivityLotteryTests() { runBatchTests('admin-activity-lottery'); }
|
|
function runAdminActivityLotteryTests() { runBatchTests('admin-activity-lottery'); }
|
|
|
function runAdminLicenseTests() { runBatchTests('admin-license'); }
|
|
function runAdminLicenseTests() { runBatchTests('admin-license'); }
|
|
|
function runAdminSystemConfigTests() { runBatchTests('admin-system-config'); }
|
|
function runAdminSystemConfigTests() { runBatchTests('admin-system-config'); }
|
|
|
|
|
+function runAdminAuditLogTests() { runBatchTests('admin-audit-log'); }
|
|
|
function runSearchRecordTests() { runBatchTests('search-record'); }
|
|
function runSearchRecordTests() { runBatchTests('search-record'); }
|
|
|
|
|
|
|
|
// ===================== 验证器 =====================
|
|
// ===================== 验证器 =====================
|