延长风控手动扫描前端超时

This commit is contained in:
zhangshy
2026-09-13 21:08:57 +08:00
parent c93c490814
commit 09c80575b7
5 changed files with 17 additions and 4 deletions
+5 -2
View File
@@ -27,7 +27,7 @@ const ENDPOINTS = Object.freeze({
RK003: { method: 'GET', path: '/api/v1/risk/alerts/{alertNo}' },
RK004: { method: 'GET', path: '/api/v1/risk/evidence/{source}' },
RK005: { method: 'GET', path: '/api/v1/risk/notifications' },
RK006: { method: 'POST', path: '/api/v1/risk/alerts/scan', idempotent: true },
RK006: { method: 'POST', path: '/api/v1/risk/alerts/scan', idempotent: true, timeout: 60000 },
RK007: { method: 'POST', path: '/api/v1/risk/alerts/{alertNo}/acknowledgements', idempotent: true },
RK008: { method: 'POST', path: '/api/v1/risk/alerts/{alertNo}/investigations', idempotent: true },
RK009: { method: 'POST', path: '/api/v1/risk/alerts/{alertNo}/exclusions', idempotent: true },
@@ -96,7 +96,10 @@ async function request(endpointId, options = {}) {
const controller = new AbortController();
const abortListener = () => controller.abort();
options.signal?.addEventListener('abort', abortListener, { once: true });
const timeoutId = window.setTimeout(() => controller.abort(), options.timeout || 8000);
const timeoutId = window.setTimeout(
() => controller.abort(),
options.timeout || endpoint.timeout || 8000,
);
try {
const response = await fetch(`${pathFor(endpoint, options.pathParams)}${queryString}`, {
method: endpoint.method,
@@ -1,4 +1,4 @@
import { apiClient } from '/static/portal/common/api-client.js?v=20260913';
import { apiClient } from '/static/portal/common/api-client.js?v=20260913-2';
import { getAuthContext, getPermissions, requireRiskStaff, updateAuthPermissions } from '/static/portal/common/auth.js';
import { escapeHtml, formatDateTime } from '/static/portal/common/formatters.js';
import { mountShell } from '/static/portal/common/layout/app-shell.js';
@@ -109,6 +109,6 @@
</form>
</dialog>
<script type="module" src="/static/portal/employee-risk/dashboard/dashboard.js"></script>
<script type="module" src="/static/portal/employee-risk/dashboard/dashboard.js?v=20260913-2"></script>
</body>
</html>