diff --git a/library/src/main/ets/components/imageknife/RequestOption.ets b/library/src/main/ets/components/imageknife/RequestOption.ets index a9b79d3..62b0e13 100644 --- a/library/src/main/ets/components/imageknife/RequestOption.ets +++ b/library/src/main/ets/components/imageknife/RequestOption.ets @@ -545,6 +545,16 @@ export class RequestOption { loadError = (err:BusinessError|string)=>{ LogUtil.log("loadError:" + err); + //失败回调 + if(this.requestListeners != undefined) { + for (let i = 0;i < this.requestListeners.length; i++) { + let requestListener = this.requestListeners[i]; + let boolInterception = requestListener.callback(err.toString(), new ImageKnifeData()); + if (boolInterception) { + break; + } + } + } // 失败占位图展示规则 if (this.retryholderFunc) { // 重试图层优先于加载失败展示