fix(auth): 去除登录入参的历史参数
This commit is contained in:
@@ -76,15 +76,16 @@ async def wechat_login(
|
||||
# 验证用户的存在/是否位首次登录
|
||||
user: User | None = await db_crud.get(filters={'wechat_openid': openid})
|
||||
if user is None:
|
||||
if not payload.encrypted_data or not payload.iv:
|
||||
await redis_conn.set(keyname, ujson.encode(wechat_session), ex=60 * 5)
|
||||
return {'status': 4001, 'message': '首次登录需要用户授权信息'}
|
||||
|
||||
if all([
|
||||
checked = all([
|
||||
payload.phone,
|
||||
payload.nickname,
|
||||
payload.avatar_url,
|
||||
]) is False:
|
||||
])
|
||||
if checked is False and wechat_session_str is None:
|
||||
await redis_conn.set(keyname, ujson.encode(wechat_session), ex=60 * 5)
|
||||
return {'status': 4001, 'message': '首次登录需要用户授权信息'}
|
||||
|
||||
if checked is False:
|
||||
raise HTTPException(status.HTTP_400_BAD_REQUEST, detail='请重试登录操作')
|
||||
|
||||
# 注册用户
|
||||
|
||||
Reference in New Issue
Block a user