feat: 2fa/otp support

This commit is contained in:
Noah Hsu
2022-08-06 01:22:13 +08:00
parent b51e664543
commit a6ed4afdae
6 changed files with 83 additions and 1 deletions

View File

@ -61,6 +61,9 @@ func UpdateUser(c *gin.Context) {
common.ErrorStrResp(c, "role can not be changed", 400)
return
}
if req.Password == "" {
req.Password = user.Password
}
if err := db.UpdateUser(&req); err != nil {
common.ErrorResp(c, err, 500)
} else {