未验证 提交 dbada508 编写于 作者: N ningning 提交者: Gitee

update zh-cn/application-dev/reference/apis/js-apis-deviceAttest.md.

Signed-off-by: Nningning <3248127340@qq.com>
上级 743cf579
...@@ -39,17 +39,17 @@ getAttestStatus(callback: AsyncCallback&lt;AttestResultInfo&gt;) : void ...@@ -39,17 +39,17 @@ getAttestStatus(callback: AsyncCallback&lt;AttestResultInfo&gt;) : void
```js ```js
try { try {
deviceAttest.getAttestStatus((error, result) => { deviceAttest.getAttestStatus((error, value) => {
if (typeof err === 'undefined') { if (typeof error != 'undefined') {
console.info("error code:" + error.code + " message:" + error.message); console.info("error code:" + error.code + " message:" + error.message);
} else { } else {
console.info("auth:" + result.authResult + " software:" + result.softwareResult + " ticket:" + result.ticket); console.info("auth:" + value.authResult + " software:" + value.softwareResult + " ticket:" + value.ticket);
console.info("versionIdResult:" + result.softwareResultDetail[0], console.info("versionIdResult:" + value.softwareResultDetail[0],
" patchlevelResult:" + result.softwareResultDetail[1], " patchlevelResult:" + value.softwareResultDetail[1],
" roothashResult:" + result.softwareResultDetail[2], " roothashResult:" + value.softwareResultDetail[2],
" PCIDResult:" + result.softwareResultDetail[3], " PCIDResult:" + value.softwareResultDetail[3],
" reserver:" + result.softwareResultDetail[4]); " reserver:" + value.softwareResultDetail[4]);
} }
}) })
} catch (error) { } catch (error) {
console.info("error code:" + error.code + " message:" + error.message); console.info("error code:" + error.code + " message:" + error.message);
...@@ -81,14 +81,14 @@ getAttestStatus() : Promise&lt;AttestResultInfo&gt; ...@@ -81,14 +81,14 @@ getAttestStatus() : Promise&lt;AttestResultInfo&gt;
```js ```js
try { try {
deviceAttest.getAttestStatus().then((value) => { deviceAttest.getAttestStatus().then((value) => {
console.info("auth:" + result.authResult + " software:" + result.softwareResult + " ticket:" + result.ticket); console.info("auth:" + value.authResult + " software:" + value.softwareResult + " ticket:" + value.ticket);
console.info("versionIdResult:" + result.softwareResultDetail[0], console.info("versionIdResult:" + value.softwareResultDetail[0],
" patchlevelResult:" + result.softwareResultDetail[1], " patchlevelResult:" + value.softwareResultDetail[1],
" roothashResult:" + result.softwareResultDetail[2], " roothashResult:" + value.softwareResultDetail[2],
" PCIDResult:" + result.softwareResultDetail[3], " PCIDResult:" + value.softwareResultDetail[3],
" reserver:" + result.softwareResultDetail[4]); " reserver:" + value.softwareResultDetail[4]);
}).catch((error) => { }).catch((error) => {
console.info("error code:" + error.code + " message:" + error.message); console.info("error code:" + error.code + " message:" + error.message);
}); });
} catch (error) { } catch (error) {
console.info("error code:" + error.code + " message:" + error.message); console.info("error code:" + error.code + " message:" + error.message);
...@@ -119,13 +119,13 @@ getAttestStatusSync() : AttestResultInfo ...@@ -119,13 +119,13 @@ getAttestStatusSync() : AttestResultInfo
```js ```js
try { try {
let attestResultInfo = deviceAttest.getAttestStatusSync(); let value = deviceAttest.getAttestStatusSync();
console.info("auth:" + result.authResult + " software:" + result.softwareResult + " ticket:" + result.ticket); console.info("auth:" + value.authResult + " software:" + value.softwareResult + " ticket:" + value.ticket);
console.info("versionIdResult:" + result.softwareResultDetail[0], console.info("versionIdResult:" + value.softwareResultDetail[0],
" patchlevelResult:" + result.softwareResultDetail[1], " patchlevelResult:" + value.softwareResultDetail[1],
" roothashResult:" + result.softwareResultDetail[2], " roothashResult:" + value.softwareResultDetail[2],
" PCIDResult:" + result.softwareResultDetail[3], " PCIDResult:" + value.softwareResultDetail[3],
" reserver:" + result.softwareResultDetail[4]); " reserver:" + value.softwareResultDetail[4]);
} catch (error) { } catch (error) {
console.info("error code:" + error.code + " message:" + error.message); console.info("error code:" + error.code + " message:" + error.message);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册