Skip to content

Commit

Permalink
Merge pull request CocaineCong#16 from CocaineCong/v2
Browse files Browse the repository at this point in the history
修复获取用户信息的context的bug
  • Loading branch information
CocaineCong authored Jul 4, 2023
2 parents 011aeba + ed49143 commit e3d80af
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/gateway/internal/http/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func GetTaskList(ctx *gin.Context) {
ctx.JSON(http.StatusBadRequest, ctl.RespError(ctx, err, "绑定参数错误"))
return
}
user, err := ctl.GetUserInfo(ctx)
user, err := ctl.GetUserInfo(ctx.Request.Context())
if err != nil {
ctx.JSON(http.StatusInternalServerError, ctl.RespError(ctx, err, "获取用户信息错误"))
return
Expand All @@ -37,7 +37,7 @@ func CreateTask(ctx *gin.Context) {
ctx.JSON(http.StatusBadRequest, ctl.RespError(ctx, err, "绑定参数错误"))
return
}
user, err := ctl.GetUserInfo(ctx)
user, err := ctl.GetUserInfo(ctx.Request.Context())
if err != nil {
ctx.JSON(http.StatusInternalServerError, ctl.RespError(ctx, err, "获取用户信息错误"))
return
Expand All @@ -58,7 +58,7 @@ func UpdateTask(ctx *gin.Context) {
ctx.JSON(http.StatusBadRequest, ctl.RespError(ctx, err, "绑定参数错误"))
return
}
user, err := ctl.GetUserInfo(ctx)
user, err := ctl.GetUserInfo(ctx.Request.Context())
if err != nil {
ctx.JSON(http.StatusInternalServerError, ctl.RespError(ctx, err, "获取用户信息错误"))
return
Expand All @@ -79,7 +79,7 @@ func DeleteTask(ctx *gin.Context) {
ctx.JSON(http.StatusBadRequest, ctl.RespError(ctx, err, "绑定参数错误"))
return
}
user, err := ctl.GetUserInfo(ctx)
user, err := ctl.GetUserInfo(ctx.Request.Context())
if err != nil {
ctx.JSON(http.StatusInternalServerError, ctl.RespError(ctx, err, "获取用户信息错误"))
return
Expand Down

0 comments on commit e3d80af

Please sign in to comment.