完成40%
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user