@ives_xxz/framework 1.2.23 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ives_xxz/framework",
3
- "version": "1.2.23",
3
+ "version": "1.3.0",
4
4
  "description": "cocoscreator 2.x mvc framework",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -84,21 +84,26 @@ export default class FWSocket implements FW.Socket {
84
84
  this.sendHeartTimestamp = 0;
85
85
  this.receiveTimeStamp = new Date().getTime();
86
86
 
87
- if (config.certificate) {
88
- let url = config.certificate.nativeUrl;
89
- if (cc.assetManager.cacheManager) {
90
- url =
91
- cc.assetManager.cacheManager.getCache(url) ||
92
- cc.assetManager.cacheManager.getTemp(url) ||
93
- url;
94
- }
95
- //@ts-ignore
96
- this.socket = new WebSocket(address, [], url);
97
- } else {
87
+ if (cc.sys.isBrowser) {
98
88
  this.socket = new WebSocket(address);
89
+ } else {
90
+ if (config.certificate) {
91
+ let url = config.certificate.nativeUrl;
92
+ if (cc.assetManager.cacheManager) {
93
+ url =
94
+ cc.assetManager.cacheManager.getCache(url) ||
95
+ cc.assetManager.cacheManager.getTemp(url) ||
96
+ url;
97
+ }
98
+ //@ts-ignore
99
+ this.socket = new WebSocket(address, [], url);
100
+ } else {
101
+ this.socket = new WebSocket(address);
102
+ }
99
103
  }
100
104
 
101
105
 
106
+
102
107
  this.socket.onopen = this.onSocketOpen.bind(this);
103
108
  this.socket.onclose = this.onSocketClose.bind(this);
104
109
  this.socket.onerror = this.onSocketError.bind(this);