diff --git a/src/HttpServer/logic/function.go b/src/HttpServer/logic/function.go index 0c76379..ba92c19 100644 --- a/src/HttpServer/logic/function.go +++ b/src/HttpServer/logic/function.go @@ -301,6 +301,20 @@ func GetTaskInfo(uuid int, tasktype int, channel string) (*TaskList, error) { var err error if tasktype == 1 { data, err = redishandler.GetRedisClient().HGet(redis.USER_TASKINFO_LIST, unqiueuuid) + //兼容老的数据 + if err != nil { + //没有读到数据 则去读取一下老的id + olddata, err := redishandler.GetRedisClient().HGet(redis.USER_TASKINFO_LIST, strconv.Itoa(uuid)) + if err == nil { + err = redishandler.GetRedisClient().HSet(redis.USER_TASKINFO_LIST, unqiueuuid, olddata) + if err == nil { + //删除老的数据 以后都走新的数据 + err = redishandler.GetRedisClient().HDel(redis.USER_TASKINFO_LIST, strconv.Itoa(uuid)) + + } + data, err = redishandler.GetRedisClient().HGet(redis.USER_TASKINFO_LIST, unqiueuuid) + } + } } else if tasktype == 2 { data, err = redishandler.GetRedisClient().HGet(redis.USER_ACHIEVEMENTINFO_LIST, unqiueuuid) //成就这一块需要兼容老的数据 -- libgit2 0.21.0