优化
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user