diff --git a/service/userService.go b/service/userService.go index eaaca60..4bfd932 100644 --- a/service/userService.go +++ b/service/userService.go @@ -425,13 +425,13 @@ func GetUserByIDFromUserCenter(id int) dao.User { fmt.Println("get user info , json marshal error:", err) return dao.User{} } - success := worker.SetRedisWithExpire(key, string(userJson), time.Second*10) + user_str = string(userJson) + success := worker.SetRedisWithExpire(key, user_str, time.Second*10) if !success { - fmt.Println("set redis error,user json:", string(userJson)) + fmt.Println("set redis error,user json:", user_str) } } } - user_str = worker.GetRedis(key) log.Println("user_str:", user_str) return user }