@ives_xxz/framework 1.6.1 → 1.6.2

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/FW.d.ts CHANGED
@@ -1170,6 +1170,7 @@ declare namespace FW {
1170
1170
  enable?: boolean;
1171
1171
  responseTime?: number;
1172
1172
  lastResponseTimestamp?: number;
1173
+ data?: any;
1173
1174
  };
1174
1175
 
1175
1176
  type FWEvent = {
@@ -336,10 +336,15 @@ export function AutoRegisterCCEvent(nodePath: string, eventName?: string) {
336
336
  }
337
337
 
338
338
  if (targetNode) {
339
- this.registerCCEvent(evt, {
340
- cb: originalMethod.bind(this),
341
- target: targetNode,
342
- });
339
+ this.registerEvent({
340
+ CCEvent: [
341
+ {
342
+ eventName: evt,
343
+ cb: originalMethod.bind(this),
344
+ target: targetNode,
345
+ }
346
+ ]
347
+ });
343
348
  FWLog.debug(`自动注册事件: ${nodePath} -> ${propertyKey}`);
344
349
  } else {
345
350
  FWLog.warn(`自动注册事件失败: 未找到节点 ${nodePath}`);
@@ -359,10 +364,15 @@ export function AutoRegisterFWEvent(eventName: any) {
359
364
 
360
365
  target.onInit = function (...args) {
361
366
  originalOnInit?.call(this, args);
362
- this.registerCCEvent(eventName, {
363
- cb: originalMethod.bind(this),
364
- target: this,
365
- });
367
+ this.registerEvent({
368
+ CCEvent: [
369
+ {
370
+ eventName: eventName,
371
+ cb: originalMethod.bind(this),
372
+ target: this,
373
+ }
374
+ ]
375
+ });
366
376
  };
367
377
  };
368
378
  }
@@ -38,14 +38,17 @@ export default abstract class FWLanguage extends cc.Component {
38
38
  }
39
39
 
40
40
  protected onLoad(): void {
41
- FW.Entry.evtMgr.register(
42
- FWEventDefine.LanguageEvent.LANGUAGE_CHANGE,
43
- () => {
41
+ this.registerEvent({
42
+ FWEvent: [
43
+ {
44
+ eventName: FWEventDefine.LanguageEvent.LANGUAGE_CHANGE,
45
+ cb: () => {
44
46
  this._language = FW.Entry.languageMgr.getLanguageIndex();
45
47
  this.onLanguageChange();
46
- },
47
- this
48
- );
48
+ }
49
+ }
50
+ ]
51
+ });
49
52
  }
50
53
 
51
54
  protected onEnable(): void {
@@ -61,6 +61,7 @@ export default class FWPromiseManager
61
61
  }
62
62
 
63
63
  const onAbort = () => {
64
+ FWLog.debug("promise abort");
64
65
  timerSchedule?.unSchedule();
65
66
  if (promiseProxy.status === FWSystemDefine.FWPromiseStatus.PENDING) {
66
67
  promiseProxy.status = FWSystemDefine.FWPromiseStatus.CANCELLED;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ives_xxz/framework",
3
- "version": "1.6.1",
3
+ "version": "1.6.2",
4
4
  "description": "cocoscreator 2.x mvc framework",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -77,7 +77,9 @@ export default class FWHttp extends FWService {
77
77
  ...FWSystemConfig.PromiseConfig.http,
78
78
  retryCondition(error, retryCount) {
79
79
  return (
80
- xhr.readyState != 4 || (xhr.status !== 200 && retryCount < 3)
80
+ error ||
81
+ xhr.readyState != 4 ||
82
+ (xhr.status !== 200 && retryCount < 3)
81
83
  );
82
84
  },
83
85
  }