fix
wangpengfei
2023-07-28 b4400a06b5f801bc7a85320680d0b6c45c547ff0
service/user.go
@@ -35,7 +35,7 @@
}
func (userService *UserService) ChangePassword(u *model.User, newPassword string) (userInter *model.User, errCode int) {
   user, err := model.NewUserSearch(nil).SetId(u.ID).First()
   user, err := model.NewUserSearch(nil).SetId(u.UUID).First()
   if err != nil {
      return nil, ecode.UserNotExist
   }
@@ -45,7 +45,7 @@
   }
   user.Password = encrypt.BcryptHash(newPassword)
   err = model.NewUserSearch(nil).SetId(u.ID).UpdateByMap(map[string]interface{}{
   err = model.NewUserSearch(nil).SetId(u.UUID).UpdateByMap(map[string]interface{}{
      "password": user.Password})
   return user, ecode.OK
@@ -71,7 +71,7 @@
}
func (userService *UserService) SetUserInfo(req model.User) error {
   return model.NewUserSearch(nil).SetId(req.ID).UpdateByMap(map[string]interface{}{
   return model.NewUserSearch(nil).SetId(req.UUID).UpdateByMap(map[string]interface{}{
      "nick_name":  req.NickName,
      "header_img": req.HeaderImg,
      "phone":      req.Phone,