From fe32704898b99e22f1450f2ee6d92c04abc31219 Mon Sep 17 00:00:00 2001 From: zzhyyyyy <2685922758@qq.com> Date: Fri, 12 Jun 2026 22:59:30 +0800 Subject: [PATCH] =?UTF-8?q?feat(user):=20=E6=98=B5=E7=A7=B0=E4=B8=8A?= =?UTF-8?q?=E9=99=90=E6=94=BE=E5=AE=BD=E5=88=B0=2020=20=E5=AD=97(=E4=B8=8E?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E7=AB=AF/=E5=8E=9F=E5=9E=8B=E4=B8=80?= =?UTF-8?q?=E8=87=B4)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ProfileUpdateRequest.nickname 的 max_length 16 → 20,与客户端 take(20) 和 原型 settings.html(maxlength=20)对齐。修复 17–20 字昵称保存时后端返回 422、 客户端弹「更新失败,请重试」的问题。DB 列为 String(64),放得下,无需迁移。 Co-Authored-By: Claude Opus 4.8 (1M context) --- app/schemas/user.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/schemas/user.py b/app/schemas/user.py index c5420b6..1c6487a 100644 --- a/app/schemas/user.py +++ b/app/schemas/user.py @@ -5,7 +5,7 @@ from pydantic import BaseModel, Field, field_validator class ProfileUpdateRequest(BaseModel): - nickname: str = Field(..., min_length=1, max_length=16, description="昵称,1-16 字") + nickname: str = Field(..., min_length=1, max_length=20, description="昵称,1-20 字") @field_validator("nickname") @classmethod