tig
This commit is contained in:
parent
94efcfaab9
commit
ad7d197c62
|
@ -76,6 +76,7 @@ def change_user_info(req: UserSchemas.ChangeUserInfoReq, token_data: TokenData =
|
|||
def bind_email(req: UserSchemas.BindEmailReq,
|
||||
db: Session = Depends(get_db)):
|
||||
email = req.email.replace(" ", "")
|
||||
|
||||
checked = EmailVerifyCode.check_code(email, req.email_code, EmailVerifyType.change)
|
||||
if not checked:
|
||||
raise HTTPException(detail="邮箱验证码错误", status_code=303)
|
||||
|
@ -131,9 +132,16 @@ def login_by_phone(req: UserSchemas.LoginByPhoneReq,
|
|||
|
||||
|
||||
@router.post("/get_email_verify_code", tags=["用户接口"], summary="获取邮箱验证码")
|
||||
def get_email_verify_code(body: UserSchemas.EmailSendReqBody):
|
||||
def get_email_verify_code(body: UserSchemas.EmailSendReqBody, db: Session = Depends(get_db)):
|
||||
try:
|
||||
email = body.email
|
||||
user = UserCrud.get_user_info(db, email)
|
||||
# if user:
|
||||
# # 邮箱已绑定
|
||||
# if user.email and user.email != req.email:
|
||||
# raise HTTPException(detail="该微信已绑定邮箱,请使用该微信号绑定的邮箱登录", status_code=403)
|
||||
if not user:
|
||||
raise HTTPException(detail="邮箱未录入系统", status_code=303)
|
||||
EmailVerifyCode.send_change_code(email)
|
||||
except HTTPException as e:
|
||||
raise e
|
||||
|
@ -174,7 +182,7 @@ def get_user_by_department_type(body: UserSchemas.GetUserByDepartmentTypeReq,
|
|||
@router.post("/get_user_can_watch_department", tags=["获取用户可查看部门列表"], summary=['查询'])
|
||||
def get_user_can_watch_department(token_data: TokenData = Depends(token_data_depend), db: Session = Depends(get_db)):
|
||||
print(token_data)
|
||||
department_list = [item.to_dict() for item in UserCrud.get_department_list(db) if item.id not in [1,2,3]]
|
||||
department_list = [item.to_dict() for item in UserCrud.get_department_list(db) if item.id not in [1, 2, 3]]
|
||||
department_dict = {item['id']: item for item in department_list}
|
||||
# 所有部门动态查看
|
||||
if check_auth(token_data.auth_data, [2]):
|
||||
|
|
Loading…
Reference in New Issue