Sfoglia il codice sorgente

修改QQ API域名

smallqiang 6 anni fa
parent
commit
77d4b2b06c
2 ha cambiato i file con 9 aggiunte e 3 eliminazioni
  1. 5 2
      assets/scripts/game/Game.js
  2. 4 1
      assets/scripts/net/Api.js

+ 5 - 2
assets/scripts/game/Game.js

@@ -161,10 +161,13 @@ cc.Class({
 
     _initSocketMng() {
         let testUrl = 'wss://test-message-taptap.duowan.com/connect';
-        // let pUrl = 'wss://new-message-taptap.duowan.com/connect';
         let pUrl = 'wss://message-taptap.duowan.com/connect';
-        let socketUrl = GameGlobal.debug ? testUrl : pUrl;
+        let qqUrl = 'wss://qq-message-taptap.duowan.com';
+        var socketUrl = GameGlobal.debug ? testUrl : pUrl;
         // let socketUrl = 'ws://172.16.15.196:9099/connect';
+        if (CC_QQPLAY) {
+            socketUrl = GameGlobal.debug ? testUrl : qqUrl;
+        }
 
         let ws = new WsManager(socketUrl, {
             binaryType: 'arraybuffer',

+ 4 - 1
assets/scripts/net/Api.js

@@ -504,7 +504,10 @@ class Api {
      * @param targetUrl [string] 请求接口
      */
     static requestUrl(targetUrl) {
-        let host = GameGlobal.debug ? 'https://test-api-taptap.duowan.com' : 'https://api-taptap.duowan.com';
+        var host = GameGlobal.debug ? 'https://test-api-taptap.duowan.com' : 'https://api-taptap.duowan.com';
+        if (CC_QQPLAY) {
+            host = GameGlobal.debug ? 'https://test-api-taptap.duowan.com' : 'https://qq-api-taptap.duowan.com';
+        }
         // let host = GameGlobal.debug ? 'http://172.16.15.196:8888' : 'https://api-allstar.duowan.com';
         // let host = 'https://new-api-taptap.duowan.com';
         return host + targetUrl;