diff --git a/zh-cn/application-dev/reference/apis/js-apis-huks.md b/zh-cn/application-dev/reference/apis/js-apis-huks.md index 66863e90ae5a378554052e0f18d2788032882cbe..0410ba49ecfed39afda7dc888c9acc713642d110 100755 --- a/zh-cn/application-dev/reference/apis/js-apis-huks.md +++ b/zh-cn/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)); + }); } ```