From 6db9e20105fb1bd1474011a05f6891d5fe64aac8 Mon Sep 17 00:00:00 2001 From: zhang-daiyue Date: Wed, 3 Aug 2022 10:39:41 +0800 Subject: [PATCH] modify js-apis-medialibrary.md Signed-off-by: zhang-daiyue Change-Id: If27c27639b01446482a8151cbf0288ea75fbe56d --- .../reference/apis/js-apis-medialibrary.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/zh-cn/application-dev/reference/apis/js-apis-medialibrary.md b/zh-cn/application-dev/reference/apis/js-apis-medialibrary.md index dfc5e94bbb..79e539d30e 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-medialibrary.md +++ b/zh-cn/application-dev/reference/apis/js-apis-medialibrary.md @@ -1912,13 +1912,11 @@ async function example() { extendArgs: "", }; let fetchFileResult = await media.getFileAssets(getImageOp); - fetchFileResult.getPositionObject(1, (err, fileAsset) => { - if (err) { - console.error('Failed '); - return; - } - console.log('fileAsset.displayName : ' + fileAsset.displayName); - }) + fetchFileResult.getPositionObject(1) .then(function (fileAsset){ + console.log('[Demo] fileAsset.displayName : ' + fileAsset.displayName); + }).catch(function (err) { + console.info("[Demo] getFileAssets failed with error:" + err); + }); } ``` -- GitLab