From a3e39182c1a4a284d0d12e5fe8c4c62bbd4eef64 Mon Sep 17 00:00:00 2001 From: CheungVane Date: Tue, 30 Aug 2022 10:15:38 +0800 Subject: [PATCH] fix code bug Signed-off-by: zhangwenzhi --- en/application-dev/reference/apis/js-apis-huks.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/en/application-dev/reference/apis/js-apis-huks.md b/en/application-dev/reference/apis/js-apis-huks.md index a4973fc1ed..6cd14aeb28 100644 --- a/en/application-dev/reference/apis/js-apis-huks.md +++ b/en/application-dev/reference/apis/js-apis-huks.md @@ -822,9 +822,9 @@ async function attestKey() { properties: properties }; generateKey(aliasString); - setTimeout(()=>huks.attestKey(aliasString, options, function (err, data) { + huks.attestKey(aliasString, options, function (err, data) { printLog(`key attest result : ${JSON.stringify(data)}`); - }), 1000); + }); } ``` @@ -894,8 +894,13 @@ async function attestKey() { properties: properties }; generateKey(aliasString); - let result = await huks.exportKey(attestKey, options); - printLog(`key attest result : ${result.errorCode}`); + huks.attestKey(aliasString, options) + .then((data) => { + console.log(`test attestKey data: ${JSON.stringify(data)}`); + }) + .catch((err) => { + console.log('test attestKey information: ' + JSON.stringify(err)); + }); } ``` -- GitLab