feat(ops): WeCom webhook alerts for pay/redeem anomalies

Add outbound group-bot alerts, rate/amount rules, stuck-order cron, HQ test button, and health db/redis checks.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-02 16:01:30 +08:00
parent cb6ecaaba6
commit 3328c52cb4
27 changed files with 1036 additions and 103 deletions
@@ -61,6 +61,34 @@ function MockSmsCodePanel({ codes, loading }: { codes: MockSmsCodeItem[]; loadin
);
}
function WecomAlertTestButton() {
const [testing, setTesting] = useState(false);
async function onTest() {
setTesting(true);
try {
const res = await request<{ ok: boolean; message: string }>(
'/admin/system-config/wecom-alert/test',
{ method: 'POST', body: '{}' },
);
message.success(res.message || '已发送测试告警');
} catch (e) {
message.error(e instanceof Error ? e.message : '发送失败');
} finally {
setTesting(false);
}
}
return (
<div style={{ marginTop: -8, marginBottom: 16 }}>
<Button size="small" loading={testing} onClick={() => void onTest()}>
</Button>
<Typography.Text type="secondary" style={{ marginLeft: 8, fontSize: 12 }}>
WECOM_ALERT_WEBHOOK_URL
</Typography.Text>
</div>
);
}
function renderField(
field: SystemConfigFieldMeta,
configuredSecrets: string[],
@@ -263,6 +291,8 @@ export default function SystemSettingsPage() {
meta.configuredSecrets,
f.key === 'MOCK_SMS' && mockSmsEnabled ? (
<MockSmsCodePanel codes={meta.mockSmsCodes ?? []} loading={loading} />
) : f.key === 'WECOM_ALERT_ENABLED' ? (
<WecomAlertTestButton />
) : undefined,
),
)}