refactor(env, i18n, http): 更新环境配置与错误提示信息

修改 .env.example,简化 API 配置说明并明确生产环境要求。更新多语言错误提示,确保用户在未启用 API 代理时获得清晰反馈。重构 admin-http.ts,优化 API 基础 URL 的解析逻辑,提升代码可维护性。
This commit is contained in:
2026-05-29 11:48:13 +08:00
parent d90ca3c66b
commit 671c737781
10 changed files with 123 additions and 54 deletions

View File

@@ -8,12 +8,12 @@ import { withAdminAuthHeader } from "@/lib/admin-auth";
import { withAdminLocaleHeaders } from "@/lib/admin-locale";
import { LotteryApiBizError, LotteryApiEnvelopeError } from "@/types/api/errors";
import { isApiEnvelope } from "@/types/api/envelope";
import { LOTTERY_API_V1_BASE } from "@/api/paths";
import { resolveLotteryApiV1Base } from "@/lib/lottery-api-base";
export { hasLotteryAdminApiBaseUrl } from "@/lib/lottery-api-env";
export const adminHttp = axios.create({
baseURL: LOTTERY_API_V1_BASE,
baseURL: resolveLotteryApiV1Base(),
timeout: 30_000,
headers: { Accept: "application/json" },
});