diff --git a/service/userService.go b/service/userService.go index 6edd7e1..dd09c8e 100644 --- a/service/userService.go +++ b/service/userService.go @@ -125,8 +125,8 @@ func UpdateUser(user_id int, req proto.UpdateUserInfoReq) (int, error) { func UpdateUserCache(id int) { key := "user_info_" + strconv.Itoa(id) if worker.IsContainKey(key) { - user := GetUserByID(id) - userJson, err := json.Marshal(user) + users := GetUserByID(id) + userJson, err := json.Marshal(users[0]) //统一使用User不使用数组 if err != nil { fmt.Println("get user info , json marshal error:", err) }