From b5aef4c48cdbda094f277aaf2675113040d0be33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98=E9=9D=A2=E6=9D=A1=E4=BE=A0=E2=80=99?= <‘wangxinxin51@h-partners.com’> Date: Wed, 10 Apr 2024 16:22:07 +0800 Subject: [PATCH] =?UTF-8?q?=20=E4=BF=AE=E6=94=B9ImageKnife=E8=B7=B3?= =?UTF-8?q?=E8=BF=87=E7=BD=91=E7=BB=9C=EF=BC=8C=E4=BB=8E=E5=86=85=E5=AD=98?= =?UTF-8?q?=E4=B8=AD=E8=8E=B7=E5=8F=96=E5=9B=BE=E7=89=87=20cacheType?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E6=9C=AA=E4=BD=BF=E7=94=A8bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ‘面条侠’ <‘wangxinxin51@h-partners.com’> --- library/src/main/ets/components/imageknife/ImageKnife.ets | 8 ++++---- .../src/main/ets/components/imageknife/RequestOption.ets | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/library/src/main/ets/components/imageknife/ImageKnife.ets b/library/src/main/ets/components/imageknife/ImageKnife.ets index 0c7ec13..b7195f7 100644 --- a/library/src/main/ets/components/imageknife/ImageKnife.ets +++ b/library/src/main/ets/components/imageknife/ImageKnife.ets @@ -343,19 +343,19 @@ export class ImageKnife { resolve(imageKnifeData); } let loadError = (err ?: BusinessError | string) => { - if (request.cacheType == CacheType.Default) { + if (cacheType == CacheType.Default) { this.loadMemoryDiskIsUrl(request, loadComplete, loadError); } reject(err); } - if (request.cacheType == CacheType.Cache) { + if (cacheType == CacheType.Cache) { this.loadMemoryCacheIsUrl(request, loadComplete, loadError); - } else if (request.cacheType == CacheType.Disk) { + } else if (cacheType == CacheType.Disk) { this.loadMemoryDiskIsUrl(request, loadComplete, loadError); } - else if (request.cacheType == CacheType.Default) { + else if (cacheType == CacheType.Default) { this.loadMemoryCacheIsUrl(request, loadComplete, loadError); } }) diff --git a/library/src/main/ets/components/imageknife/RequestOption.ets b/library/src/main/ets/components/imageknife/RequestOption.ets index c7e383e..3d2c610 100644 --- a/library/src/main/ets/components/imageknife/RequestOption.ets +++ b/library/src/main/ets/components/imageknife/RequestOption.ets @@ -95,7 +95,6 @@ export class RequestOption { addHeaderMap(map: Map) { this.headers = map; } - cacheType: CacheType = CacheType.Disk; // 优先级 priority: Priority = Priority.MEDIUM;