|
|
@@ -16,7 +16,7 @@ db_dependency = Depends(get_db_connection)
|
|
|
|
|
|
|
|
|
class BindCardRequest(BaseModel):
|
|
|
- user_id: int = Field(..., ge=0)
|
|
|
+ user_id: str = Field(..., min_length=1)
|
|
|
bind_card_id: List[int] = Field(default_factory=list)
|
|
|
unbind_card_id: List[int] = Field(default_factory=list)
|
|
|
|
|
|
@@ -53,9 +53,8 @@ def get_current_user(x_user_base64: Optional[str] = Header(None, alias="X-USER-B
|
|
|
if not isinstance(role_code_list, list):
|
|
|
raise _auth_exception("X-USER-BASE64 的 roleCodeList 格式错误")
|
|
|
|
|
|
- try:
|
|
|
- user_id = int(user_id)
|
|
|
- except (TypeError, ValueError):
|
|
|
+ user_id = str(user_id).strip()
|
|
|
+ if not user_id:
|
|
|
raise _auth_exception("X-USER-BASE64 的用户 id 格式错误")
|
|
|
|
|
|
return {
|