|
|
|
@ -59,7 +59,7 @@ async def update_user(user:UserUpdate, |
|
|
|
|
return Result.failed(msg=f"update user error: {ex}") |
|
|
|
|
|
|
|
|
|
@router.put("/update/{user_id}/{status}") |
|
|
|
|
async def update_user_status(user_id: int,status: str ): |
|
|
|
|
async def update_user_status(user_id: int,status: str): |
|
|
|
|
|
|
|
|
|
try: |
|
|
|
|
return Result.succ(userDao.update_status(user_id, status)) |
|
|
|
@ -68,10 +68,8 @@ async def update_user_status(user_id: int,status: str ): |
|
|
|
|
return Result.failed(msg=f"update user error: {ex}") |
|
|
|
|
|
|
|
|
|
@router.put("/update-pwd") |
|
|
|
|
async def update_user_password(user_password: UserPassword ): |
|
|
|
|
user_info: UserRequest = Depends(get_user_from_headers) |
|
|
|
|
if user_info: |
|
|
|
|
raise Exception(f"登录已失效,请重新登录") |
|
|
|
|
async def update_user_password(user_password: UserPassword ,user_info: UserRequest = Depends(get_user_from_headers)): |
|
|
|
|
|
|
|
|
|
try: |
|
|
|
|
# 密码加密 |
|
|
|
|
hashed_password = bcrypt.hashpw(user_password.password.encode('utf-8'), bcrypt.gensalt()) |
|
|
|
|