From 543de2ec28d6fcc61c344654ac9162f98fcd4b78 Mon Sep 17 00:00:00 2001 From: 陆恒 Date: Wed, 2 Sep 2020 10:13:18 +0800 Subject: [PATCH] 提交 --- src/HttpServer/logic/logic.go | 2 +- src/mysql/dbmysql.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/HttpServer/logic/logic.go b/src/HttpServer/logic/logic.go index b21909f..bef007c 100644 --- a/src/HttpServer/logic/logic.go +++ b/src/HttpServer/logic/logic.go @@ -1195,7 +1195,6 @@ func HandlerLogin(w http.ResponseWriter, data string, uuid int) { //不存在 //属于新登录的玩家数据 //需要判断是否存在mysql中 - logger.Info("GetUserInfo from mysql") //return nil, err //从mysql读取 err,info,task,ach,isfind := mysql.GetFromBackUp(uniqueuuid) @@ -1209,6 +1208,7 @@ func HandlerLogin(w http.ResponseWriter, data string, uuid int) { } if isfind { + logger.Info("GetUserInfo from mysql uid=%v",uniqueuuid) //先保存数据 err = redishandler.GetRedisClient().HSet(redis.USER_DATA_KEY, uniqueuuid,info) err = redishandler.GetRedisClient().HSet(redis.USER_TASKINFO_LIST, uniqueuuid,task) diff --git a/src/mysql/dbmysql.go b/src/mysql/dbmysql.go index ba22f83..276207c 100644 --- a/src/mysql/dbmysql.go +++ b/src/mysql/dbmysql.go @@ -48,7 +48,7 @@ func ExcuteCmd(cmd string) error { func GetFromBackUp(uniqueid string) (error,string,string,string,bool) { isfind := false - cmd := "select info,task,achieve from hedaoshi where uid = " + uniqueid + cmd := "select info,task,achieve from hedaoshi where uid = '" + uniqueid + "'" rows, err := m_game_db.Query(cmd) if rows != nil { defer rows.Close() -- libgit2 0.21.0