|
|
@@ -53,36 +53,39 @@ func init() {
|
|
|
serverproto.Handle_GAME_CSLoginReq = model.HandleBackendMessage(func(ev rocommon.ProcEvent, cliId model.ClientID) {
|
|
|
msg := ev.Msg().(*serverproto.CSLoginReq)
|
|
|
util.InfoF("receive CSLoginReq msg=%v cliId=%v", msg, cliId)
|
|
|
- token := msg.PlatformToken
|
|
|
- sign := getmd5("a8faf2c0acaaa5ef5d23860f219d7538" + token)
|
|
|
- //tmpRequest := &XiaoQILoginResp{}
|
|
|
- urlPath := "https://api.x7sy.com/user/check_v4_login?tokenkey=" + token + "&sign=" + sign
|
|
|
- util.InfoF("urlPath=%v", urlPath)
|
|
|
-
|
|
|
- resp, err := http.Get(urlPath)
|
|
|
- if err != nil {
|
|
|
- util.ErrorF("login sdk check error:%v", err)
|
|
|
- }
|
|
|
- defer resp.Body.Close() // 确保关闭响应体
|
|
|
-
|
|
|
- // 读取响应体
|
|
|
- body, _ := io.ReadAll(resp.Body)
|
|
|
- res := string(body)
|
|
|
- //err := httpNode.(rocommon.HTTPConnector).Request("GET", urlPath, tmpRequest)
|
|
|
- util.InfoF("tmpRequest.ResMsg:%v", res)
|
|
|
+ var gguid []byte
|
|
|
var resRu XiaoQILoginResp
|
|
|
- err = json.Unmarshal(body, &resRu)
|
|
|
- if err != nil {
|
|
|
- util.ErrorF("auth login json Unmarshal err:%v", err)
|
|
|
- }
|
|
|
- msg.OpenId = resRu.Data.Guid
|
|
|
- gguid, _ := json.Marshal(resRu.Data)
|
|
|
- if msg.OpenId == "" {
|
|
|
- ack := &serverproto.SCLoginAck{
|
|
|
- Error: int32(serverproto.ErrorCode_ERROR_FAIL),
|
|
|
+ if msg.Platform != "PC" {
|
|
|
+ token := msg.PlatformToken
|
|
|
+ sign := getmd5("a8faf2c0acaaa5ef5d23860f219d7538" + token)
|
|
|
+ //tmpRequest := &XiaoQILoginResp{}
|
|
|
+ urlPath := "https://api.x7sy.com/user/check_v4_login?tokenkey=" + token + "&sign=" + sign
|
|
|
+ util.InfoF("urlPath=%v", urlPath)
|
|
|
+
|
|
|
+ resp, err := http.Get(urlPath)
|
|
|
+ if err != nil {
|
|
|
+ util.ErrorF("login sdk check error:%v", err)
|
|
|
+ }
|
|
|
+ defer resp.Body.Close() // 确保关闭响应体
|
|
|
+
|
|
|
+ // 读取响应体
|
|
|
+ body, _ := io.ReadAll(resp.Body)
|
|
|
+ res := string(body)
|
|
|
+ //err := httpNode.(rocommon.HTTPConnector).Request("GET", urlPath, tmpRequest)
|
|
|
+ util.InfoF("tmpRequest.ResMsg:%v", res)
|
|
|
+ err = json.Unmarshal(body, &resRu)
|
|
|
+ if err != nil {
|
|
|
+ util.ErrorF("auth login json Unmarshal err:%v", err)
|
|
|
+ }
|
|
|
+ msg.OpenId = resRu.Data.Guid
|
|
|
+ gguid, _ = json.Marshal(resRu.Data)
|
|
|
+ if msg.OpenId == "" {
|
|
|
+ ack := &serverproto.SCLoginAck{
|
|
|
+ Error: int32(serverproto.ErrorCode_ERROR_FAIL),
|
|
|
+ }
|
|
|
+ model.ServiceReplay(ev, ack)
|
|
|
+ return
|
|
|
}
|
|
|
- model.ServiceReplay(ev, ack)
|
|
|
- return
|
|
|
}
|
|
|
|
|
|
if msg.GameVersion > 0 && msg.GameVersion != int32(serverproto.GameVersion_GameVersion_Main) {
|