fix(密钥检测): 直连失败重试一次,超时/网络提示中文化

上游 ai.t8star.org 实测约 1/8 单请求完全不应答(主机 A 上 JDK 客户端
HTTP/1.1 与 HTTP/2 均复现),检测只有一次机会时用户会看到
「网络不可达:HttpTimeoutException: request timed out」。

- 传输层失败(超时/网络不可达)对直连最后一跳重试一次(800ms 间隔);
  代理模块不重试——jikip 按提取次数计费,重试会多扣一次
- 失败文案中文化(新增 CODE_TIMEOUT),英文异常串只进服务端日志
- 探测提问改「你好」(最简一次调用)
- 检测面板标明检测对象(配置密钥 sk-**** / 输入值(未保存)),
  检测接口超时单独放宽(客户端 60s / 后台 180s),避免重试期间前端先超时
This commit is contained in:
2026-09-14 00:28:35 +08:00
parent fd614004b0
commit 864c22ffc7
5 changed files with 175 additions and 36 deletions
@@ -71,11 +71,13 @@ export function deleteMyApiSecret(moduleKey: string) {
}
/** value 非空时检测输入值(不落库);为空时检测服务端已存密钥并把结果落库。 */
/** 检测连通性:服务端最多「首查 + 传输层失败重试一次」,最坏约 31s,故单独放宽超时。 */
export function checkMyApiSecret(moduleKey: string, value?: string) {
return unwrapJavaResponse(
post<JavaApiResponse<UserApiSecretCheckResult>, { value?: string }>(
buildJavaUrl(API_ENDPOINTS.userSecret.check.replace('{moduleKey}', encodeURIComponent(moduleKey))),
{ value },
{ timeout: 60000 },
),
)
}