Commit 0906c0c50dcdfeeb82e0528b294f21c5d7594084
1 parent
34d0f92b
Exists in
master
and in
4 other branches
提交
Showing
2 changed files
with
14 additions
and
4 deletions
Show diff stats
src/HttpServer/logic/datadef.go
... | ... | @@ -264,10 +264,10 @@ type UsersignResp struct { |
264 | 264 | } |
265 | 265 | |
266 | 266 | type ReadNumUploadReq struct { |
267 | - Uid int `json:"uid"` | |
267 | + Uid string `json:"uid"` | |
268 | 268 | Readnum int `json:"readnum"` |
269 | - Gameid string `json:"gameid"` | |
270 | - Channel string `json:"channel"` | |
269 | + //Gameid string `json:"gameid"` | |
270 | + //Channel string `json:"channel"` | |
271 | 271 | } |
272 | 272 | |
273 | 273 | type ReadNumUploadResp struct { | ... | ... |
src/HttpServer/logic/logic.go
... | ... | @@ -9,6 +9,7 @@ import ( |
9 | 9 | "fmt" |
10 | 10 | "net/http" |
11 | 11 | "strconv" |
12 | + "strings" | |
12 | 13 | ) |
13 | 14 | |
14 | 15 | func HandlerQueryguaninfo(w http.ResponseWriter, data string, uuid int) { |
... | ... | @@ -447,8 +448,17 @@ func HandlerReadNumUpload(w http.ResponseWriter, data string) { |
447 | 448 | break |
448 | 449 | } |
449 | 450 | |
451 | + //先解析uuid | |
452 | + params := strings.Split(rdata.Uid, "-") | |
453 | + if len(params) != 3 { | |
454 | + logger.Info("json decode HandlerReadNumUpload data failed:%v,for:%v", err, data) | |
455 | + resp.Message = "参数不正确 请检查" | |
456 | + resp.Code = ERROR_JSONUNMASH_ERROR | |
457 | + break | |
458 | + } | |
459 | + | |
450 | 460 | //需要加上渠道才是唯一的玩家id,不同渠道视为不同数据 |
451 | - uniqueuuid := strconv.Itoa(rdata.Uid) + rdata.Channel | |
461 | + uniqueuuid := params[2] + params[1] | |
452 | 462 | uinfo, err := GetUserInfo(uniqueuuid) |
453 | 463 | if err != nil || uinfo == nil { |
454 | 464 | logger.Error("HandlerReadNumUpload redis failed err=%v", err) | ... | ... |