This commit is contained in:
2026-11-04 19:27:40 +08:00
parent e341551190
commit 63fac79814
3 changed files with 10 additions and 5 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ export function containerReference(source = {}) {
}
export function sanitizeUserMessage(message, fallback = '操作失败') {
const raw = String(message ?? '').trim()
const raw = String(message ?? '').replace(/[((]\s*(?:错误码|code|requestId|traceId)\s*[::=][\s\S]*$/i, '').replace(/(?:requestId|traceId)\s*[::=][\s\S]*$/i, '').trim()
if (!raw) return fallback
if (/^internal server error$/i.test(raw)) return '服务端处理异常,请联系管理员'
const sanitized = raw