update
This commit is contained in:
parent
7ec1415428
commit
210f0643df
@ -44,8 +44,8 @@ async def login(
|
||||
return StandardResponse(code=200, message="登录成功", data=User.model_validate(user))
|
||||
|
||||
def generate_user_code():
|
||||
"""生成个人邀请码,6位数字加字母"""
|
||||
return ''.join(random.choices(string.ascii_letters + string.digits, k=6))
|
||||
"""生成个人邀请码,6位数字加大写字母"""
|
||||
return ''.join(random.choices(string.ascii_uppercase + string.digits, k=6))
|
||||
|
||||
@router.post("/login/wechat", tags=["auth"])
|
||||
async def wechat_login(
|
||||
@ -106,6 +106,7 @@ async def wechat_login(
|
||||
user.user_code = generate_user_code()
|
||||
user.nickname = f"搭友{user.user_code}"
|
||||
user.avatar = settings.DEFAULT_AVATAR
|
||||
user.tryon_remain_count = settings.TRYON_REMAIN_COUNT
|
||||
await db.commit()
|
||||
await db.refresh(user)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user