init: 初始化 dpb 桃育种系统代码库

前后端 + 后端 FastAPI 全量源码、部署脚本与文档。
This commit is contained in:
34047007@qq.com
2026-08-06 00:17:49 +08:00
commit b95053c52c
1469 changed files with 322298 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
import { $t } from "@/locales";
/** 后端登录失败细分文案 → i18n 键(zh 值 = 后端现有文案,en 值见 locales */
const AUTH_MSG_KEYS: Record<string, string> = {
"账号或密码错误": "login.auth.invalidCredentials",
"用户不存在": "login.auth.userNotFound",
"用户已被停用": "login.auth.userDisabled",
"验证码不能为空": "login.auth.captchaEmpty",
"验证码标识不能为空": "login.auth.captchaIdEmpty",
"验证码已过期,请刷新": "login.auth.captchaExpired",
"验证码已使用": "login.auth.captchaUsed",
"请先完成滑块验证": "login.auth.sliderRequired",
"登录类型不能为空": "login.auth.loginTypeEmpty",
};
/** 已知后端登录失败文案 → 翻译;未命中返回 null(调用方用通用 fallback */
export function translateAuthError(msg?: string): string | null {
const key = msg ? AUTH_MSG_KEYS[msg] : undefined;
return key ? $t(key) : null;
}