From 189f21be0fcb3d4707ca8feeacf61fba2a21aad6 Mon Sep 17 00:00:00 2001 From: zhanghongnian3 Date: Mon, 29 Jan 2024 20:12:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A4=B1=E8=B4=A5=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E5=9B=9E=E8=B0=83=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/ets/components/imageknife/RequestOption.ets | 10 ++++++++++ 1 file changed, 10 insertions(+) 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) { // 重试图层优先于加载失败展示