完成40%

This commit is contained in:
rain
2026-07-23 17:21:27 +08:00
parent f1edc6b533
commit bb6431b319
114 changed files with 10931 additions and 877 deletions
+20 -3
View File
@@ -4,9 +4,6 @@ export const AUTH_TAC_SCENE = Object.freeze({
FORGOT_PASSWORD: "APP_FORGOT_PASSWORD",
});
export const PASSWORD_TAC_BLOCKED_MESSAGE =
"密码登录的服务端安全验证尚未开放,请先使用验证码登录";
const SUPPORTED_TAC_TYPES = new Set([
"SLIDER",
"ROTATE",
@@ -112,3 +109,23 @@ export const normalizeTacSuccess = (value, expectedRequestId) => {
}
return { requestId: value.requestId, validToken, expireSeconds };
};
export const isSmsDeliveryOutcomeUnknown = (error) => {
if (!error || typeof error !== "object") return false;
if (
error.code === "REQUEST_TIMEOUT" ||
error.code === "NETWORK_ERROR" ||
error.code === "RESPONSE_INVALID" ||
error.code === "REQUEST_CANCELLED"
) {
return true;
}
if (error.code === "HTTP_ERROR" || error.code === "BUSINESS_ERROR") {
const status = Number(
error.code === "HTTP_ERROR" ? error.httpStatus : error.businessCode,
);
if (!Number.isInteger(status)) return true;
return !(status >= 400 && status < 500 && status !== 408);
}
return false;
};