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

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

Signed-off-by: Nningning <3248127340@qq.com>
上级 743cf579
......@@ -39,16 +39,16 @@ getAttestStatus(callback: AsyncCallback&lt;AttestResultInfo&gt;) : void
```js
try {
deviceAttest.getAttestStatus((error, result) => {
if (typeof err === 'undefined') {
deviceAttest.getAttestStatus((error, value) => {
if (typeof error != '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]);
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) {
......@@ -81,12 +81,12 @@ getAttestStatus() : Promise&lt;AttestResultInfo&gt;
```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);
});
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册