From 22fc3e6f9c83222b77c5d44baec51ecbbcd25146 Mon Sep 17 00:00:00 2001 From: zwx1126739 Date: Thu, 13 Jun 2024 10:24:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=A4=87=E5=BF=98=E5=BD=95?= =?UTF-8?q?=E6=8F=92=E5=85=A5=E4=B8=8D=E5=90=8C=E5=9B=BE=E7=89=87=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=90=8C=E4=B8=80=E5=BC=A0=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zwx1126739 --- .../utils/src/main/ets/default/baseUtil/OperationUtils.ets | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/common/utils/src/main/ets/default/baseUtil/OperationUtils.ets b/common/utils/src/main/ets/default/baseUtil/OperationUtils.ets index 58b3a22..0462888 100644 --- a/common/utils/src/main/ets/default/baseUtil/OperationUtils.ets +++ b/common/utils/src/main/ets/default/baseUtil/OperationUtils.ets @@ -15,6 +15,7 @@ import {LogUtil} from './LogUtil' import {MediaLibraryAccess} from '../access/MediaLibraryAccess'; +import dataSharePredicates from '@ohos.data.dataSharePredicates'; import fileio from '@ohos.fileio'; const TAG = "OperationUtils" @@ -113,10 +114,10 @@ export class OperationUtils { async getFileAssetById(imagePath, context){ LogUtil.info(TAG, 'getFileAssetById', imagePath); + let predicates: dataSharePredicates.DataSharePredicates = new dataSharePredicates.DataSharePredicates(); let fetchOpt = { - selections : '', - selectionArgs : [], - uri:imagePath + fetchColumns: [], + predicates: predicates.equalTo('uri',imagePath) } try {