Commit a3d78f8e54bd36364bd84725693b986a9fa18271

Authored by 陆恒
1 parent e1e72a6c
Exists in master

提交

src/HttpServer/logic/httpserver.go
@@ -74,7 +74,7 @@ func Testsendhttp() { @@ -74,7 +74,7 @@ func Testsendhttp() {
74 return 74 return
75 } 75 }
76 body := bytes.NewBuffer(bys) 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 reqest, err := http.NewRequest("POST", url1, body) 78 reqest, err := http.NewRequest("POST", url1, body)
79 if err != nil { 79 if err != nil {
80 logger.Error("http.NewRequest failed") 80 logger.Error("http.NewRequest failed")
@@ -746,14 +746,14 @@ func GetUserData(w http.ResponseWriter, r *http.Request) { @@ -746,14 +746,14 @@ func GetUserData(w http.ResponseWriter, r *http.Request) {
746 } 746 }
747 747
748 func UserLogin(w http.ResponseWriter, r *http.Request) { 748 func UserLogin(w http.ResponseWriter, r *http.Request) {
749 - /*logger.Info("%%%%%%%%%%%%%%%%path=%v", *r.URL) 749 + logger.Info("%%%%%%%%%%%%%%%%path=%v", *r.URL)
750 for k, v := range r.Header { 750 for k, v := range r.Header {
751 logger.Info("*********************key=%v,value=%v", k, v) 751 logger.Info("*********************key=%v,value=%v", k, v)
752 } 752 }
753 753
754 w.Header().Add("Access-Control-Allow-Headers", "") 754 w.Header().Add("Access-Control-Allow-Headers", "")
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") 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 Uuid := 0 757 Uuid := 0
758 Token := "" 758 Token := ""
759 if len(r.Header) > 0 { 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,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 if !isexist { 49 if !isexist {
50 //不存在 50 //不存在
51 //属于新登录的玩家数据 51 //属于新登录的玩家数据
52 - InitUserInfo(&rdata, &resp, uuid) 52 + InitUserInfo(&rdata, &resp, rdata.UserId)
53 53
54 } else { 54 } else {
55 uinfo,err := GetUserInfo(strconv.Itoa(rdata.UserId)) 55 uinfo,err := GetUserInfo(strconv.Itoa(rdata.UserId))