Skip to content

Commit

Permalink
Style: Format code
Browse files Browse the repository at this point in the history
  • Loading branch information
ckappgit committed Jul 14, 2024
1 parent 581f0ff commit 500306f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions internal/service/user/reset.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ type SetRequest struct {

// 重置密码 (POST /password/reset)
func ReSetPass(c *gin.Context) {
//绑定参数
// 绑定参数
var req SetRequest
if err := c.ShouldBindJSON(&req); err != nil {
util.AbortWithMsg(c, "invalid request")
return
}
fmt.Println(req.Newpassword)
//鉴权
// 鉴权
userID, err := util.GetUserIDFromGinContext(c)
if err != nil {
util.AbortWithMsg(c, "Please login first")
Expand All @@ -32,12 +32,11 @@ func ReSetPass(c *gin.Context) {
return
}

//修改密码
// 修改密码
err = SetUserPass(user, req.Newpassword)
if err != nil {
util.AbortWithMsg(c, "reset password fail")
}
//返回
// 返回
util.OKWithMsg(c, "reset password success")

}

0 comments on commit 500306f

Please sign in to comment.