diff --git a/zh-cn/application-dev/reference/apis/js-apis-deviceAttest.md b/zh-cn/application-dev/reference/apis/js-apis-deviceAttest.md index c6b6648d7e23244d740b49d7a29420740336f6f8..fcecb535db789222fec6203aa14eadcb8afd5dbb 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-deviceAttest.md +++ b/zh-cn/application-dev/reference/apis/js-apis-deviceAttest.md @@ -39,17 +39,17 @@ getAttestStatus(callback: AsyncCallback<AttestResultInfo>) : void ```js try { - deviceAttest.getAttestStatus((error, result) => { - if (typeof err === 'undefined') { - console.info("error code:" + error.code + " message:" + error.message); - } else { - console.info("auth:" + result.authResult + " software:" + result.softwareResult + " ticket:" + result.ticket); - console.info("versionIdResult:" + result.softwareResultDetail[0], - " patchlevelResult:" + result.softwareResultDetail[1], - " roothashResult:" + result.softwareResultDetail[2], - " PCIDResult:" + result.softwareResultDetail[3], - " reserver:" + result.softwareResultDetail[4]); - } + deviceAttest.getAttestStatus((error, value) => { + if (typeof error != 'undefined') { + console.info("error code:" + error.code + " message:" + error.message); + } else { + console.info("auth:" + value.authResult + " software:" + value.softwareResult + " ticket:" + value.ticket); + console.info("versionIdResult:" + value.softwareResultDetail[0], + " patchlevelResult:" + value.softwareResultDetail[1], + " roothashResult:" + value.softwareResultDetail[2], + " PCIDResult:" + value.softwareResultDetail[3], + " reserver:" + value.softwareResultDetail[4]); + } }) } catch (error) { console.info("error code:" + error.code + " message:" + error.message); @@ -81,14 +81,14 @@ getAttestStatus() : Promise<AttestResultInfo> ```js try { deviceAttest.getAttestStatus().then((value) => { - console.info("auth:" + result.authResult + " software:" + result.softwareResult + " ticket:" + result.ticket); - console.info("versionIdResult:" + result.softwareResultDetail[0], - " patchlevelResult:" + result.softwareResultDetail[1], - " roothashResult:" + result.softwareResultDetail[2], - " PCIDResult:" + result.softwareResultDetail[3], - " reserver:" + result.softwareResultDetail[4]); + console.info("auth:" + value.authResult + " software:" + value.softwareResult + " ticket:" + value.ticket); + console.info("versionIdResult:" + value.softwareResultDetail[0], + " patchlevelResult:" + value.softwareResultDetail[1], + " roothashResult:" + value.softwareResultDetail[2], + " PCIDResult:" + value.softwareResultDetail[3], + " reserver:" + value.softwareResultDetail[4]); }).catch((error) => { - console.info("error code:" + error.code + " message:" + error.message); + console.info("error code:" + error.code + " message:" + error.message); }); } catch (error) { console.info("error code:" + error.code + " message:" + error.message); @@ -119,13 +119,13 @@ getAttestStatusSync() : AttestResultInfo ```js try { - let attestResultInfo = deviceAttest.getAttestStatusSync(); - console.info("auth:" + result.authResult + " software:" + result.softwareResult + " ticket:" + result.ticket); - console.info("versionIdResult:" + result.softwareResultDetail[0], - " patchlevelResult:" + result.softwareResultDetail[1], - " roothashResult:" + result.softwareResultDetail[2], - " PCIDResult:" + result.softwareResultDetail[3], - " reserver:" + result.softwareResultDetail[4]); + let value = deviceAttest.getAttestStatusSync(); + console.info("auth:" + value.authResult + " software:" + value.softwareResult + " ticket:" + value.ticket); + console.info("versionIdResult:" + value.softwareResultDetail[0], + " patchlevelResult:" + value.softwareResultDetail[1], + " roothashResult:" + value.softwareResultDetail[2], + " PCIDResult:" + value.softwareResultDetail[3], + " reserver:" + value.softwareResultDetail[4]); } catch (error) { console.info("error code:" + error.code + " message:" + error.message); }