Commit a3d78f8e54bd36364bd84725693b986a9fa18271

Authored by 陆恒
1 parent e1e72a6c
Exists in master

提交

src/HttpServer/logic/httpserver.go
... ... @@ -74,7 +74,7 @@ func Testsendhttp() {
74 74 return
75 75 }
76 76 body := bytes.NewBuffer(bys)
77   - url1 := "https://192.144.198.179:50064/api/account/login"
  77 + url1 := "http://192.144.198.179:50064/api/account/login"
78 78 reqest, err := http.NewRequest("POST", url1, body)
79 79 if err != nil {
80 80 logger.Error("http.NewRequest failed")
... ... @@ -746,14 +746,14 @@ func GetUserData(w http.ResponseWriter, r *http.Request) {
746 746 }
747 747  
748 748 func UserLogin(w http.ResponseWriter, r *http.Request) {
749   - /*logger.Info("%%%%%%%%%%%%%%%%path=%v", *r.URL)
  749 + logger.Info("%%%%%%%%%%%%%%%%path=%v", *r.URL)
750 750 for k, v := range r.Header {
751 751 logger.Info("*********************key=%v,value=%v", k, v)
752 752 }
753 753  
754 754 w.Header().Add("Access-Control-Allow-Headers", "")
755 755 w.Header().Set("Access-Control-Allow-Headers", "Authorization, Content-Length, X-CSRF-Token, Token,session,X_Requested_With,Accept, Origin, Host, Connection, Accept-Encoding, Accept-Language,DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, Cache-Control, Content-Type, Pragma")
756   -*/
  756 +
757 757 Uuid := 0
758 758 Token := ""
759 759 if len(r.Header) > 0 {
... ...
src/HttpServer/logic/logic.go
... ... @@ -45,11 +45,11 @@ func HandlerLogin(w http.ResponseWriter, data string, uuid int,token string) {
45 45 }
46 46  
47 47 //首先判断一下是否是首次登陆
48   - isexist, _ := redishandler.GetRedisClient().HExists(redis.USER_INFO__KEY, strconv.Itoa(uuid))
  48 + isexist, _ := redishandler.GetRedisClient().HExists(redis.USER_INFO__KEY, strconv.Itoa(rdata.UserId))
49 49 if !isexist {
50 50 //不存在
51 51 //属于新登录的玩家数据
52   - InitUserInfo(&rdata, &resp, uuid)
  52 + InitUserInfo(&rdata, &resp, rdata.UserId)
53 53  
54 54 } else {
55 55 uinfo,err := GetUserInfo(strconv.Itoa(rdata.UserId))
... ...