R25-1 R25-2 R25-3: 修复登录改密并收口静态缓存
这个提交包含在:
@@ -1,3 +1,13 @@
|
||||
function readStringList(value: unknown): string[] {
|
||||
if (!Array.isArray(value)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return value
|
||||
.map((item) => (typeof item === "string" ? item.trim() : ""))
|
||||
.filter((item) => item.length > 0);
|
||||
}
|
||||
|
||||
export function mapApiErrorMessage(
|
||||
code: string,
|
||||
details?: Record<string, unknown>,
|
||||
@@ -75,6 +85,15 @@ export function mapApiErrorMessage(
|
||||
}
|
||||
|
||||
if (code === "VALID_001") {
|
||||
const passwordErrors = readStringList(details?.password);
|
||||
if (passwordErrors.length) {
|
||||
return `新密码不符合要求:${passwordErrors.join(";")}。`;
|
||||
}
|
||||
|
||||
if (details?.["x-device-fingerprint"] === "missing") {
|
||||
return "当前设备校验信息缺失,请刷新页面后重试。";
|
||||
}
|
||||
|
||||
if (details?.payment === "already_paid_conflict") {
|
||||
return "该报销单已支付且付款信息冲突,请刷新后确认。";
|
||||
}
|
||||
|
||||
在新工单中引用
屏蔽一个用户