feat(workers): integrate workers to handlers

This commit is contained in:
hexxa 2021-09-05 22:26:55 +08:00 committed by Hexxa
parent 0e7f39b8cc
commit e47ee4aa8c
8 changed files with 265 additions and 113 deletions

View file

@ -239,13 +239,13 @@ func (h *MultiUsersSvc) SetPwd(c *gin.Context) {
}
user, err := h.deps.Users().GetUser(uid)
if err != nil {
c.JSON(q.ErrResp(c, 401, err))
c.JSON(q.ErrResp(c, 402, err))
return
}
err = bcrypt.CompareHashAndPassword([]byte(user.Pwd), []byte(req.OldPwd))
if err != nil {
c.JSON(q.ErrResp(c, 401, ErrInvalidUser))
c.JSON(q.ErrResp(c, 403, ErrInvalidUser))
return
}