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

@@ -16,7 +16,7 @@
"submit": "Log in",
"submitting": "Signing in…",
"captchaLoadFailed": "Failed to load captcha. Check the API or network.",
"apiBaseMissingToast": "API not configured: set API_BASE_URL in admin .env.local (Next proxy) or NEXT_PUBLIC_LOTTERY_API_BASE_URL (direct)",
"apiBaseMissingToast": "API proxy is not enabled: make sure /api is forwarded to Laravel",
"captchaRequired": "Refresh the captcha first",
"welcome": "Welcome, {{name}}",
"networkFailed": "Network request failed",

View File

@@ -16,7 +16,7 @@
"submit": "लगइन",
"submitting": "लगइन हुँदैछ…",
"captchaLoadFailed": "क्याप्चा लोड गर्न सकिएन। API वा नेटवर्क जाँच गर्नुहोस्।",
"apiBaseMissingToast": "API कन्फिग गरिएको छैन: admin .env.local मा API_BASE_URL (Next proxy) वा NEXT_PUBLIC_LOTTERY_API_BASE_URL (direct) सेट गर्नुहोस्",
"apiBaseMissingToast": "API proxy सक्षम छैन: /api Laravel मा forward भएको छ कि छैन जाँच गर्नुहोस्",
"captchaRequired": "पहिले क्याप्चा रिफ्रेस गर्नुहोस्",
"welcome": "स्वागत छ, {{name}}",
"networkFailed": "नेटवर्क अनुरोध असफल भयो",

View File

@@ -16,7 +16,7 @@
"submit": "登录",
"submitting": "登录中…",
"captchaLoadFailed": "无法获取验证码,请检查接口或网络",
"apiBaseMissingToast": "未配置 API请在管理端 .env.local 设置 API_BASE_URLNext 反代),或设置 NEXT_PUBLIC_LOTTERY_API_BASE_URL直连",
"apiBaseMissingToast": "API 代理未启用:请确认宝塔或本地 Next 已转发 /api 到 Laravel",
"captchaRequired": "请先刷新验证码",
"welcome": "欢迎,{{name}}",
"networkFailed": "网络请求失败",