未验证 提交 a5764c37 编写于 作者: O openharmony_ci 提交者: Gitee

!9750 代码规范整改

Merge pull request !9750 from fanchenxuan/master
...@@ -28,7 +28,7 @@ getAccountManager(): AccountManager ...@@ -28,7 +28,7 @@ getAccountManager(): AccountManager
**示例:** **示例:**
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
``` ```
## OsAccountType ## OsAccountType
...@@ -68,10 +68,10 @@ activateOsAccount(localId: number, callback: AsyncCallback<void>): void ...@@ -68,10 +68,10 @@ activateOsAccount(localId: number, callback: AsyncCallback<void>): void
**示例:**激活ID为100的系统帐号 **示例:**激活ID为100的系统帐号
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
var localId = 100; let localId = 100;
accountManager.activateOsAccount(localId, (err)=>{ accountManager.activateOsAccount(localId, (err)=>{
console.log("activateOsAccount err:" + JSON.stringify(err)); console.log('activateOsAccount err:' + JSON.stringify(err));
}); });
``` ```
...@@ -101,12 +101,12 @@ activateOsAccount(localId: number): Promise<void> ...@@ -101,12 +101,12 @@ activateOsAccount(localId: number): Promise<void>
**示例:**激活ID为100的系统帐号 **示例:**激活ID为100的系统帐号
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
var localId = 100; let localId = 100;
accountManager.activateOsAccount(localId).then(() => { accountManager.activateOsAccount(localId).then(() => {
console.log("activateOsAccount success"); console.log('activateOsAccount success');
}).catch((err) => { }).catch((err) => {
console.log("activateOsAccount err:" + JSON.stringify(err)); console.log('activateOsAccount err:' + JSON.stringify(err));
}); });
``` ```
...@@ -127,9 +127,9 @@ isMultiOsAccountEnable(callback: AsyncCallback<boolean>): void ...@@ -127,9 +127,9 @@ isMultiOsAccountEnable(callback: AsyncCallback<boolean>): void
**示例:** **示例:**
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
accountManager.isMultiOsAccountEnable((err, isEnabled) => { accountManager.isMultiOsAccountEnable((err, isEnabled) => {
console.log("isMultiOsAccountEnable err: " + JSON.stringify(err)); console.log('isMultiOsAccountEnable err: ' + JSON.stringify(err));
console.log('isMultiOsAccountEnable isEnabled: ' + isEnabled); console.log('isMultiOsAccountEnable isEnabled: ' + isEnabled);
}); });
``` ```
...@@ -151,11 +151,11 @@ isMultiOsAccountEnable(): Promise<boolean> ...@@ -151,11 +151,11 @@ isMultiOsAccountEnable(): Promise<boolean>
**示例:** **示例:**
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
accountManager.isMultiOsAccountEnable().then((isEnabled) => { accountManager.isMultiOsAccountEnable().then((isEnabled) => {
console.log('isMultiOsAccountEnable, isEnabled: ' + isEnabled); console.log('isMultiOsAccountEnable, isEnabled: ' + isEnabled);
}).catch((err) => { }).catch((err) => {
console.log("isMultiOsAccountEnable err: " + JSON.stringify(err)); console.log('isMultiOsAccountEnable err: ' + JSON.stringify(err));
}); });
``` ```
...@@ -179,11 +179,11 @@ isOsAccountActived(localId: number, callback: AsyncCallback<boolean>): voi ...@@ -179,11 +179,11 @@ isOsAccountActived(localId: number, callback: AsyncCallback<boolean>): voi
**示例:**判断ID为100的系统帐号是否处于激活状态 **示例:**判断ID为100的系统帐号是否处于激活状态
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
var osLocalId = 100; let osLocalId = 100;
accountManager.isOsAccountActived(osLocalId, (err, isActive)=>{ accountManager.isOsAccountActived(osLocalId, (err, isActive)=>{
console.log("isOsAccountActived err:" + JSON.stringify(err)); console.log('isOsAccountActived err:' + JSON.stringify(err));
console.log("isOsAccountActived isActive:" + isActive); console.log('isOsAccountActived isActive:' + isActive);
}); });
``` ```
...@@ -212,12 +212,12 @@ isOsAccountActived(localId: number): Promise<boolean> ...@@ -212,12 +212,12 @@ isOsAccountActived(localId: number): Promise<boolean>
**示例:**判断ID为100的系统帐号是否处于激活状态 **示例:**判断ID为100的系统帐号是否处于激活状态
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
var osLocalId = 100; let osLocalId = 100;
accountManager.isOsAccountActived(osLocalId).then((isActive) => { accountManager.isOsAccountActived(osLocalId).then((isActive) => {
console.log('isOsAccountActived, isActive: ' + isActive); console.log('isOsAccountActived, isActive: ' + isActive);
}).catch((err) => { }).catch((err) => {
console.log("isOsAccountActived err: " + JSON.stringify(err)); console.log('isOsAccountActived err: ' + JSON.stringify(err));
}); });
``` ```
...@@ -242,11 +242,11 @@ isOsAccountConstraintEnable(localId: number, constraint: string, callback: Async ...@@ -242,11 +242,11 @@ isOsAccountConstraintEnable(localId: number, constraint: string, callback: Async
**示例:**判断ID为100的系统帐号是否有禁止使用wifi的约束 **示例:**判断ID为100的系统帐号是否有禁止使用wifi的约束
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
var localId = 100; let localId = 100;
accountManager.isOsAccountConstraintEnable(localId, "constraint.wifi", (err, isConstraintEnabled)=>{ accountManager.isOsAccountConstraintEnable(localId, 'constraint.wifi', (err, isConstraintEnabled)=>{
console.log("isOsAccountConstraintEnable err:" + JSON.stringify(err)); console.log('isOsAccountConstraintEnable err:' + JSON.stringify(err));
console.log("isOsAccountConstraintEnable isConstraintEnabled:" + isConstraintEnabled); console.log('isOsAccountConstraintEnable isConstraintEnabled:' + isConstraintEnabled);
}); });
``` ```
...@@ -276,12 +276,12 @@ isOsAccountConstraintEnable(localId: number, constraint: string): Promise<boo ...@@ -276,12 +276,12 @@ isOsAccountConstraintEnable(localId: number, constraint: string): Promise<boo
**示例:**判断ID为100的系统帐号是否有禁止使用wifi的约束 **示例:**判断ID为100的系统帐号是否有禁止使用wifi的约束
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
var localId = 100; let localId = 100;
accountManager.isOsAccountConstraintEnable(localId, "constraint.wifi").then((isConstraintEnabled) => { accountManager.isOsAccountConstraintEnable(localId, 'constraint.wifi').then((isConstraintEnabled) => {
console.log('isOsAccountConstraintEnable, isConstraintEnabled: ' + isConstraintEnabled); console.log('isOsAccountConstraintEnable, isConstraintEnabled: ' + isConstraintEnabled);
}).catch((err) => { }).catch((err) => {
console.log("isOsAccountConstraintEnable err: " + JSON.stringify(err)); console.log('isOsAccountConstraintEnable err: ' + JSON.stringify(err));
}); });
``` ```
...@@ -302,9 +302,9 @@ isTestOsAccount(callback: AsyncCallback<boolean>): void ...@@ -302,9 +302,9 @@ isTestOsAccount(callback: AsyncCallback<boolean>): void
**示例:** **示例:**
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
accountManager.isTestOsAccount((err, isTest) => { accountManager.isTestOsAccount((err, isTest) => {
console.log("isTestOsAccount err: " + JSON.stringify(err)); console.log('isTestOsAccount err: ' + JSON.stringify(err));
console.log('isTestOsAccount isTest: ' + isTest); console.log('isTestOsAccount isTest: ' + isTest);
}); });
``` ```
...@@ -326,11 +326,11 @@ isTestOsAccount(): Promise<boolean> ...@@ -326,11 +326,11 @@ isTestOsAccount(): Promise<boolean>
**示例:** **示例:**
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
accountManager.isTestOsAccount().then((isTest) => { accountManager.isTestOsAccount().then((isTest) => {
console.log('isTestOsAccount, isTest: ' + isTest); console.log('isTestOsAccount, isTest: ' + isTest);
}).catch((err) => { }).catch((err) => {
console.log("isTestOsAccount err: " + JSON.stringify(err)); console.log('isTestOsAccount err: ' + JSON.stringify(err));
}); });
``` ```
...@@ -351,9 +351,9 @@ isOsAccountVerified(callback: AsyncCallback<boolean>): void ...@@ -351,9 +351,9 @@ isOsAccountVerified(callback: AsyncCallback<boolean>): void
**示例:** **示例:**
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
accountManager.isOsAccountVerified((err, isVerified) => { accountManager.isOsAccountVerified((err, isVerified) => {
console.log("isOsAccountVerified err: " + JSON.stringify(err)); console.log('isOsAccountVerified err: ' + JSON.stringify(err));
console.log('isOsAccountVerified isVerified: ' + isVerified); console.log('isOsAccountVerified isVerified: ' + isVerified);
}); });
``` ```
...@@ -378,9 +378,9 @@ isOsAccountVerified(localId: number, callback: AsyncCallback<boolean>): vo ...@@ -378,9 +378,9 @@ isOsAccountVerified(localId: number, callback: AsyncCallback<boolean>): vo
**示例:** **示例:**
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
accountManager.isOsAccountVerified((err, isVerified) => { accountManager.isOsAccountVerified((err, isVerified) => {
console.log("isOsAccountVerified err: " + JSON.stringify(err)); console.log('isOsAccountVerified err: ' + JSON.stringify(err));
console.log('isOsAccountVerified isVerified: ' + isVerified); console.log('isOsAccountVerified isVerified: ' + isVerified);
}); });
``` ```
...@@ -410,11 +410,11 @@ isOsAccountVerified(localId?: number): Promise<boolean> ...@@ -410,11 +410,11 @@ isOsAccountVerified(localId?: number): Promise<boolean>
**示例:** **示例:**
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
accountManager.isOsAccountVerified().then((isVerified) => { accountManager.isOsAccountVerified().then((isVerified) => {
console.log('isOsAccountVerified, isVerified: ' + isVerified); console.log('isOsAccountVerified, isVerified: ' + isVerified);
}).catch((err) => { }).catch((err) => {
console.log("isOsAccountVerified err: " + JSON.stringify(err)); console.log('isOsAccountVerified err: ' + JSON.stringify(err));
}); });
``` ```
...@@ -440,10 +440,10 @@ removeOsAccount(localId: number, callback: AsyncCallback<void>): void ...@@ -440,10 +440,10 @@ removeOsAccount(localId: number, callback: AsyncCallback<void>): void
**示例:** **示例:**
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
accountManager.createOsAccount("testAccountName", account_osAccount.OsAccountType.NORMAL, (err, osAccountInfo) => { accountManager.createOsAccount('testAccountName', account_osAccount.OsAccountType.NORMAL, (err, osAccountInfo) => {
accountManager.removeOsAccount(osAccountInfo.localId, (err)=>{ accountManager.removeOsAccount(osAccountInfo.localId, (err)=>{
console.log("removeOsAccount err:" + JSON.stringify(err)); console.log('removeOsAccount err:' + JSON.stringify(err));
}); });
}); });
``` ```
...@@ -475,12 +475,12 @@ removeOsAccount(localId: number): Promise<void> ...@@ -475,12 +475,12 @@ removeOsAccount(localId: number): Promise<void>
**示例:** **示例:**
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
accountManager.createOsAccount("testAccountName", account_osAccount.OsAccountType.NORMAL, (err, osAccountInfo)=>{ accountManager.createOsAccount('testAccountName', account_osAccount.OsAccountType.NORMAL, (err, osAccountInfo)=>{
accountManager.removeOsAccount(osAccountInfo.localId).then(() => { accountManager.removeOsAccount(osAccountInfo.localId).then(() => {
console.log('removeOsAccount Success'); console.log('removeOsAccount Success');
}).catch(() => { }).catch(() => {
console.log("removeOsAccount err: " + JSON.stringify(err)); console.log('removeOsAccount err: ' + JSON.stringify(err));
}); });
}); });
``` ```
...@@ -509,10 +509,10 @@ setOsAccountConstraints(localId: number, constraints: Array<string>, enabl ...@@ -509,10 +509,10 @@ setOsAccountConstraints(localId: number, constraints: Array<string>, enabl
**示例:**给ID为100的系统帐号设置禁止使用wifi的约束 **示例:**给ID为100的系统帐号设置禁止使用wifi的约束
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
var localId = 100; let localId = 100;
accountManager.setOsAccountConstraints(localId, ["constraint.wifi"], true, (err)=>{ accountManager.setOsAccountConstraints(localId, ['constraint.wifi'], true, (err)=>{
console.log("setOsAccountConstraints err:" + JSON.stringify(err)); console.log('setOsAccountConstraints err:' + JSON.stringify(err));
}); });
``` ```
...@@ -545,12 +545,12 @@ setOsAccountConstraints(localId: number, constraints: Array<string>, enabl ...@@ -545,12 +545,12 @@ setOsAccountConstraints(localId: number, constraints: Array<string>, enabl
**示例:**删除ID为100的系统帐号的禁止使用wifi的约束 **示例:**删除ID为100的系统帐号的禁止使用wifi的约束
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
var localId = 100; let localId = 100;
accountManager.setOsAccountConstraints(localId, ["constraint.location.set"], false).then(() => { accountManager.setOsAccountConstraints(localId, ['constraint.location.set'], false).then(() => {
console.log('setOsAccountConstraints Success'); console.log('setOsAccountConstraints Success');
}).catch((err) => { }).catch((err) => {
console.log("setOsAccountConstraints err: " + JSON.stringify(err)); console.log('setOsAccountConstraints err: ' + JSON.stringify(err));
}); });
``` ```
...@@ -577,11 +577,11 @@ setOsAccountName(localId: number, localName: string, callback: AsyncCallback< ...@@ -577,11 +577,11 @@ setOsAccountName(localId: number, localName: string, callback: AsyncCallback<
**示例:**将ID为100的系统帐号的帐号名设置成demoName **示例:**将ID为100的系统帐号的帐号名设置成demoName
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
var localId = 100; let localId = 100;
var newName = "demoName"; let newName = 'demoName';
accountManager.setOsAccountName(localId, newName, (err)=>{ accountManager.setOsAccountName(localId, newName, (err)=>{
console.debug("setOsAccountName err:" + JSON.stringify(err)); console.debug('setOsAccountName err:' + JSON.stringify(err));
}); });
``` ```
...@@ -613,13 +613,13 @@ setOsAccountName(localId: number, localName: string): Promise<void> ...@@ -613,13 +613,13 @@ setOsAccountName(localId: number, localName: string): Promise<void>
**示例:**将ID为100的系统帐号的帐号名设置成demoName **示例:**将ID为100的系统帐号的帐号名设置成demoName
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
var localId = 100; let localId = 100;
var nameLimit = "demoName"; let nameLimit = 'demoName';
accountManager.setOsAccountName(localId, nameLimit).then(() => { accountManager.setOsAccountName(localId, nameLimit).then(() => {
console.log('setOsAccountName Success'); console.log('setOsAccountName Success');
}).catch((err) => { }).catch((err) => {
console.log("setOsAccountName err: " + JSON.stringify(err)); console.log('setOsAccountName err: ' + JSON.stringify(err));
}); });
``` ```
...@@ -642,10 +642,10 @@ getCreatedOsAccountsCount(callback: AsyncCallback<number>): void ...@@ -642,10 +642,10 @@ getCreatedOsAccountsCount(callback: AsyncCallback<number>): void
**示例:** **示例:**
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
accountManager.getCreatedOsAccountsCount((err, accountCnt)=>{ accountManager.getCreatedOsAccountsCount((err, accountCnt)=>{
console.log("obtains the number of all os accounts created err:" + JSON.stringify(err)); console.log('obtains the number of all os accounts created err:' + JSON.stringify(err));
console.log("obtains the number of all os accounts created accountCnt:" + accountCnt); console.log('obtains the number of all os accounts created accountCnt:' + accountCnt);
}); });
``` ```
...@@ -668,11 +668,11 @@ getCreatedOsAccountsCount(): Promise<number> ...@@ -668,11 +668,11 @@ getCreatedOsAccountsCount(): Promise<number>
**示例:** **示例:**
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
accountManager.getCreatedOsAccountsCount().then((accountCnt) => { accountManager.getCreatedOsAccountsCount().then((accountCnt) => {
console.log('getCreatedOsAccountsCount, accountCnt: ' + accountCnt); console.log('getCreatedOsAccountsCount, accountCnt: ' + accountCnt);
}).catch((err) => { }).catch((err) => {
console.log("getCreatedOsAccountsCount err: " + JSON.stringify(err)); console.log('getCreatedOsAccountsCount err: ' + JSON.stringify(err));
}); });
``` ```
...@@ -693,9 +693,9 @@ getOsAccountLocalIdFromProcess(callback: AsyncCallback<number>): void ...@@ -693,9 +693,9 @@ getOsAccountLocalIdFromProcess(callback: AsyncCallback<number>): void
**示例:** **示例:**
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
accountManager.getOsAccountLocalIdFromProcess((err, accountID) => { accountManager.getOsAccountLocalIdFromProcess((err, accountID) => {
console.log("getOsAccountLocalIdFromProcess err: " + JSON.stringify(err)); console.log('getOsAccountLocalIdFromProcess err: ' + JSON.stringify(err));
console.log('getOsAccountLocalIdFromProcess accountID: ' + accountID); console.log('getOsAccountLocalIdFromProcess accountID: ' + accountID);
}); });
``` ```
...@@ -717,11 +717,11 @@ getOsAccountLocalIdFromProcess(): Promise<number> ...@@ -717,11 +717,11 @@ getOsAccountLocalIdFromProcess(): Promise<number>
**示例:** **示例:**
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
accountManager.getOsAccountLocalIdFromProcess().then((accountID) => { accountManager.getOsAccountLocalIdFromProcess().then((accountID) => {
console.log('getOsAccountLocalIdFromProcess, accountID: ' + accountID); console.log('getOsAccountLocalIdFromProcess, accountID: ' + accountID);
}).catch((err) => { }).catch((err) => {
console.log("getOsAccountLocalIdFromProcess err: " + JSON.stringify(err)); console.log('getOsAccountLocalIdFromProcess err: ' + JSON.stringify(err));
}); });
``` ```
...@@ -743,10 +743,10 @@ getOsAccountLocalIdFromUid(uid: number, callback: AsyncCallback<number>): ...@@ -743,10 +743,10 @@ getOsAccountLocalIdFromUid(uid: number, callback: AsyncCallback<number>):
**示例:**查询值为12345678的uid所属的系统帐号的帐号ID **示例:**查询值为12345678的uid所属的系统帐号的帐号ID
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
let uid = 12345678; let uid = 12345678;
accountManager.getOsAccountLocalIdFromUid(uid, (err, accountID) => { accountManager.getOsAccountLocalIdFromUid(uid, (err, accountID) => {
console.log("getOsAccountLocalIdFromUid err: " + JSON.stringify(err)); console.log('getOsAccountLocalIdFromUid err: ' + JSON.stringify(err));
console.log('getOsAccountLocalIdFromUid: ' + accountID); console.log('getOsAccountLocalIdFromUid: ' + accountID);
}); });
``` ```
...@@ -774,12 +774,12 @@ getOsAccountLocalIdFromUid(uid: number): Promise<number> ...@@ -774,12 +774,12 @@ getOsAccountLocalIdFromUid(uid: number): Promise<number>
**示例:**查询值为12345678的uid所属的系统帐号的帐号ID **示例:**查询值为12345678的uid所属的系统帐号的帐号ID
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
let uid = 12345678; let uid = 12345678;
accountManager.getOsAccountLocalIdFromUid(uid).then((accountID) => { accountManager.getOsAccountLocalIdFromUid(uid).then((accountID) => {
console.log('getOsAccountLocalIdFromUid: ' + accountID); console.log('getOsAccountLocalIdFromUid: ' + accountID);
}).catch((err) => { }).catch((err) => {
console.log("getOsAccountLocalIdFromUid err: " + JSON.stringify(err)); console.log('getOsAccountLocalIdFromUid err: ' + JSON.stringify(err));
}); });
``` ```
...@@ -803,10 +803,10 @@ getOsAccountLocalIdFromDomain(domainInfo: DomainAccountInfo, callback: AsyncCall ...@@ -803,10 +803,10 @@ getOsAccountLocalIdFromDomain(domainInfo: DomainAccountInfo, callback: AsyncCall
**示例:** **示例:**
```js ```js
var domainInfo = {domain: "testDomain", accountName: "testAccountName"}; let domainInfo = {domain: 'testDomain', accountName: 'testAccountName'};
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
accountManager.getOsAccountLocalIdFromDomain(domainInfo, (err, accountID) => { accountManager.getOsAccountLocalIdFromDomain(domainInfo, (err, accountID) => {
console.log("getOsAccountLocalIdFromDomain: " + JSON.stringify(err)); console.log('getOsAccountLocalIdFromDomain: ' + JSON.stringify(err));
console.log('getOsAccountLocalIdFromDomain: ' + accountID); console.log('getOsAccountLocalIdFromDomain: ' + accountID);
}); });
``` ```
...@@ -836,12 +836,12 @@ getOsAccountLocalIdFromDomain(domainInfo: DomainAccountInfo): Promise<number& ...@@ -836,12 +836,12 @@ getOsAccountLocalIdFromDomain(domainInfo: DomainAccountInfo): Promise<number&
**示例:** **示例:**
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
var domainInfo = {domain: "testDomain", accountName: "testAccountName"}; let domainInfo = {domain: 'testDomain', accountName: 'testAccountName'};
accountManager.getOsAccountLocalIdFromDomain(domainInfo).then((accountID) => { accountManager.getOsAccountLocalIdFromDomain(domainInfo).then((accountID) => {
console.log('getOsAccountLocalIdFromDomain: ' + accountID); console.log('getOsAccountLocalIdFromDomain: ' + accountID);
}).catch((err) => { }).catch((err) => {
console.log("getOsAccountLocalIdFromDomain err: " + JSON.stringify(err)); console.log('getOsAccountLocalIdFromDomain err: ' + JSON.stringify(err));
}); });
``` ```
...@@ -864,10 +864,10 @@ queryMaxOsAccountNumber(callback: AsyncCallback<number>): void ...@@ -864,10 +864,10 @@ queryMaxOsAccountNumber(callback: AsyncCallback<number>): void
**示例:** **示例:**
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
accountManager.queryMaxOsAccountNumber((err, maxCnt)=>{ accountManager.queryMaxOsAccountNumber((err, maxCnt)=>{
console.log("queryMaxOsAccountNumber err:" + JSON.stringify(err)); console.log('queryMaxOsAccountNumber err:' + JSON.stringify(err));
console.log("queryMaxOsAccountNumber maxCnt:" + maxCnt); console.log('queryMaxOsAccountNumber maxCnt:' + maxCnt);
}); });
``` ```
...@@ -890,11 +890,11 @@ queryMaxOsAccountNumber(): Promise<number> ...@@ -890,11 +890,11 @@ queryMaxOsAccountNumber(): Promise<number>
**示例:** **示例:**
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
accountManager.queryMaxOsAccountNumber().then((maxCnt) => { accountManager.queryMaxOsAccountNumber().then((maxCnt) => {
console.log('queryMaxOsAccountNumber, maxCnt: ' + maxCnt); console.log('queryMaxOsAccountNumber, maxCnt: ' + maxCnt);
}).catch((err) => { }).catch((err) => {
console.log("queryMaxOsAccountNumber err: " + JSON.stringify(err)); console.log('queryMaxOsAccountNumber err: ' + JSON.stringify(err));
}); });
``` ```
...@@ -918,11 +918,11 @@ getOsAccountAllConstraints(localId: number, callback: AsyncCallback<Array< ...@@ -918,11 +918,11 @@ getOsAccountAllConstraints(localId: number, callback: AsyncCallback<Array<
**示例:**获取ID为100的系统帐号的全部约束 **示例:**获取ID为100的系统帐号的全部约束
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
var localId = 100; let localId = 100;
accountManager.getOsAccountAllConstraints(localId, (err, constraints)=>{ accountManager.getOsAccountAllConstraints(localId, (err, constraints)=>{
console.log("getOsAccountAllConstraints err:" + JSON.stringify(err)); console.log('getOsAccountAllConstraints err:' + JSON.stringify(err));
console.log("getOsAccountAllConstraints:" + JSON.stringify(constraints)); console.log('getOsAccountAllConstraints:' + JSON.stringify(constraints));
}); });
``` ```
...@@ -951,12 +951,12 @@ getOsAccountAllConstraints(localId: number): Promise<Array<string>> ...@@ -951,12 +951,12 @@ getOsAccountAllConstraints(localId: number): Promise<Array<string>>
**示例:**获取ID为100的系统帐号的全部约束 **示例:**获取ID为100的系统帐号的全部约束
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
var localId = 100; let localId = 100;
accountManager.getOsAccountAllConstraints(localId).then((constraints) => { accountManager.getOsAccountAllConstraints(localId).then((constraints) => {
console.log("getOsAccountAllConstraints, constraints: " + constraints); console.log('getOsAccountAllConstraints, constraints: ' + constraints);
}).catch((err) => { }).catch((err) => {
console.log("getOsAccountAllConstraints err: " + JSON.stringify(err)); console.log('getOsAccountAllConstraints err: ' + JSON.stringify(err));
}); });
``` ```
...@@ -981,10 +981,10 @@ queryAllCreatedOsAccounts(callback: AsyncCallback<Array<OsAccountInfo>& ...@@ -981,10 +981,10 @@ queryAllCreatedOsAccounts(callback: AsyncCallback<Array<OsAccountInfo>&
**示例:** **示例:**
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
accountManager.queryAllCreatedOsAccounts((err, accountArr)=>{ accountManager.queryAllCreatedOsAccounts((err, accountArr)=>{
console.log("queryAllCreatedOsAccounts err:" + JSON.stringify(err)); console.log('queryAllCreatedOsAccounts err:' + JSON.stringify(err));
console.log("queryAllCreatedOsAccounts accountArr:" + JSON.stringify(accountArr)); console.log('queryAllCreatedOsAccounts accountArr:' + JSON.stringify(accountArr));
}); });
``` ```
...@@ -1009,11 +1009,11 @@ queryAllCreatedOsAccounts(): Promise<Array<OsAccountInfo>> ...@@ -1009,11 +1009,11 @@ queryAllCreatedOsAccounts(): Promise<Array<OsAccountInfo>>
**示例:** **示例:**
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
accountManager.queryAllCreatedOsAccounts().then((accountArr) => { accountManager.queryAllCreatedOsAccounts().then((accountArr) => {
console.log('queryAllCreatedOsAccounts, accountArr: ' + JSON.stringify(accountArr)); console.log('queryAllCreatedOsAccounts, accountArr: ' + JSON.stringify(accountArr));
}).catch((err) => { }).catch((err) => {
console.log("queryAllCreatedOsAccounts err: " + JSON.stringify(err)); console.log('queryAllCreatedOsAccounts err: ' + JSON.stringify(err));
}); });
``` ```
...@@ -1034,12 +1034,12 @@ queryActivatedOsAccountIds(callback: AsyncCallback<Array<number>>): ...@@ -1034,12 +1034,12 @@ queryActivatedOsAccountIds(callback: AsyncCallback<Array<number>>):
**示例:** **示例:**
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
accountManager.queryActivatedOsAccountIds((err, idArray)=>{ accountManager.queryActivatedOsAccountIds((err, idArray)=>{
console.log("queryActivatedOsAccountIds err:" + JSON.stringify(err)); console.log('queryActivatedOsAccountIds err:' + JSON.stringify(err));
console.log("queryActivatedOsAccountIds idArray length:" + idArray.length); console.log('queryActivatedOsAccountIds idArray length:' + idArray.length);
for(var i=0;i<idArray.length;i++) { for(let i=0;i<idArray.length;i++) {
console.info("activated os account id: " + idArray[i]); console.info('activated os account id: ' + idArray[i]);
} }
}); });
``` ```
...@@ -1061,11 +1061,11 @@ queryActivatedOsAccountIds(): Promise&lt;Array&lt;number&gt;&gt; ...@@ -1061,11 +1061,11 @@ queryActivatedOsAccountIds(): Promise&lt;Array&lt;number&gt;&gt;
**示例:** **示例:**
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
accountManager.queryActivatedOsAccountIds().then((idArray) => { accountManager.queryActivatedOsAccountIds().then((idArray) => {
console.log('queryActivatedOsAccountIds, idArray: ' + idArray); console.log('queryActivatedOsAccountIds, idArray: ' + idArray);
}).catch((err) => { }).catch((err) => {
console.log("queryActivatedOsAccountIds err: " + JSON.stringify(err)); console.log('queryActivatedOsAccountIds err: ' + JSON.stringify(err));
}); });
``` ```
...@@ -1092,10 +1092,10 @@ createOsAccount(localName: string, type: OsAccountType, callback: AsyncCallback& ...@@ -1092,10 +1092,10 @@ createOsAccount(localName: string, type: OsAccountType, callback: AsyncCallback&
**示例:** **示例:**
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
accountManager.createOsAccount("testName", account_osAccount.OsAccountType.NORMAL, (err, osAccountInfo)=>{ accountManager.createOsAccount('testName', account_osAccount.OsAccountType.NORMAL, (err, osAccountInfo)=>{
console.log("createOsAccount err:" + JSON.stringify(err)); console.log('createOsAccount err:' + JSON.stringify(err));
console.log("createOsAccount osAccountInfo:" + JSON.stringify(osAccountInfo)); console.log('createOsAccount osAccountInfo:' + JSON.stringify(osAccountInfo));
}); });
``` ```
...@@ -1127,11 +1127,11 @@ createOsAccount(localName: string, type: OsAccountType): Promise&lt;OsAccountInf ...@@ -1127,11 +1127,11 @@ createOsAccount(localName: string, type: OsAccountType): Promise&lt;OsAccountInf
**示例:** **示例:**
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
accountManager.createOsAccount("testAccountName", account_osAccount.OsAccountType.NORMAL).then((accountInfo) => { accountManager.createOsAccount('testAccountName', account_osAccount.OsAccountType.NORMAL).then((accountInfo) => {
console.log("createOsAccount, accountInfo: " + JSON.stringify(accountInfo)); console.log('createOsAccount, accountInfo: ' + JSON.stringify(accountInfo));
}).catch((err) => { }).catch((err) => {
console.log("createOsAccount err: " + JSON.stringify(err)); console.log('createOsAccount err: ' + JSON.stringify(err));
}); });
``` ```
...@@ -1158,11 +1158,11 @@ createOsAccountForDomain(type: OsAccountType, domainInfo: DomainAccountInfo, cal ...@@ -1158,11 +1158,11 @@ createOsAccountForDomain(type: OsAccountType, domainInfo: DomainAccountInfo, cal
**示例:** **示例:**
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
var domainInfo = {domain: "testDomain", accountName: "testAccountName"}; let domainInfo = {domain: 'testDomain', accountName: 'testAccountName'};
accountManager.createOsAccountForDomain(account_osAccount.OsAccountType.NORMAL, domainInfo, (err, osAccountInfo)=>{ accountManager.createOsAccountForDomain(account_osAccount.OsAccountType.NORMAL, domainInfo, (err, osAccountInfo)=>{
console.log("createOsAccountForDomain err:" + JSON.stringify(err)); console.log('createOsAccountForDomain err:' + JSON.stringify(err));
console.log("createOsAccountForDomain osAccountInfo:" + JSON.stringify(osAccountInfo)); console.log('createOsAccountForDomain osAccountInfo:' + JSON.stringify(osAccountInfo));
}); });
``` ```
...@@ -1194,12 +1194,12 @@ createOsAccountForDomain(type: OsAccountType, domainInfo: DomainAccountInfo): Pr ...@@ -1194,12 +1194,12 @@ createOsAccountForDomain(type: OsAccountType, domainInfo: DomainAccountInfo): Pr
**示例:** **示例:**
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
var domainInfo = {domain: "testDomain", accountName: "testAccountName"}; let domainInfo = {domain: 'testDomain', accountName: 'testAccountName'};
accountManager.createOsAccountForDomain(account_osAccount.OsAccountType.NORMAL, domainInfo).then((accountInfo) => { accountManager.createOsAccountForDomain(account_osAccount.OsAccountType.NORMAL, domainInfo).then((accountInfo) => {
console.log("createOsAccountForDomain, account info: " + JSON.stringify(accountInfo)); console.log('createOsAccountForDomain, account info: ' + JSON.stringify(accountInfo));
}).catch((err) => { }).catch((err) => {
console.log("createOsAccountForDomain err: " + JSON.stringify(err)); console.log('createOsAccountForDomain err: ' + JSON.stringify(err));
}); });
``` ```
...@@ -1222,10 +1222,10 @@ queryCurrentOsAccount(callback: AsyncCallback&lt;OsAccountInfo&gt;): void ...@@ -1222,10 +1222,10 @@ queryCurrentOsAccount(callback: AsyncCallback&lt;OsAccountInfo&gt;): void
**示例:** **示例:**
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
accountManager.queryCurrentOsAccount((err, curAccountInfo)=>{ accountManager.queryCurrentOsAccount((err, curAccountInfo)=>{
console.log("queryCurrentOsAccount err:" + JSON.stringify(err)); console.log('queryCurrentOsAccount err:' + JSON.stringify(err));
console.log("queryCurrentOsAccount curAccountInfo:" + JSON.stringify(curAccountInfo)); console.log('queryCurrentOsAccount curAccountInfo:' + JSON.stringify(curAccountInfo));
}); });
``` ```
...@@ -1248,11 +1248,11 @@ queryCurrentOsAccount(): Promise&lt;OsAccountInfo&gt; ...@@ -1248,11 +1248,11 @@ queryCurrentOsAccount(): Promise&lt;OsAccountInfo&gt;
**示例:** **示例:**
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
accountManager.queryCurrentOsAccount().then((accountInfo) => { accountManager.queryCurrentOsAccount().then((accountInfo) => {
console.log("queryCurrentOsAccount, accountInfo: " + JSON.stringify(accountInfo)); console.log('queryCurrentOsAccount, accountInfo: ' + JSON.stringify(accountInfo));
}).catch((err) => { }).catch((err) => {
console.log("queryCurrentOsAccount err: " + JSON.stringify(err)); console.log('queryCurrentOsAccount err: ' + JSON.stringify(err));
}); });
``` ```
...@@ -1278,11 +1278,11 @@ queryOsAccountById(localId: number, callback: AsyncCallback&lt;OsAccountInfo&gt; ...@@ -1278,11 +1278,11 @@ queryOsAccountById(localId: number, callback: AsyncCallback&lt;OsAccountInfo&gt;
**示例:**查询ID为100的系统帐号信息 **示例:**查询ID为100的系统帐号信息
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
var localId = 100; let localId = 100;
accountManager.queryOsAccountById(localId, (err, accountInfo)=>{ accountManager.queryOsAccountById(localId, (err, accountInfo)=>{
console.log("queryOsAccountById err:" + JSON.stringify(err)); console.log('queryOsAccountById err:' + JSON.stringify(err));
console.log("queryOsAccountById accountInfo:" + JSON.stringify(accountInfo)); console.log('queryOsAccountById accountInfo:' + JSON.stringify(accountInfo));
}); });
``` ```
...@@ -1313,12 +1313,12 @@ queryOsAccountById(localId: number): Promise&lt;OsAccountInfo&gt; ...@@ -1313,12 +1313,12 @@ queryOsAccountById(localId: number): Promise&lt;OsAccountInfo&gt;
**示例:**查询ID为100的系统帐号信息 **示例:**查询ID为100的系统帐号信息
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
var localId = 100; let localId = 100;
accountManager.queryOsAccountById(localId).then((accountInfo) => { accountManager.queryOsAccountById(localId).then((accountInfo) => {
console.log("queryOsAccountById, accountInfo: " + JSON.stringify(accountInfo)); console.log('queryOsAccountById, accountInfo: ' + JSON.stringify(accountInfo));
}).catch((err) => { }).catch((err) => {
console.log("queryOsAccountById err: " + JSON.stringify(err)); console.log('queryOsAccountById err: ' + JSON.stringify(err));
}); });
``` ```
...@@ -1339,9 +1339,9 @@ getOsAccountTypeFromProcess(callback: AsyncCallback&lt;OsAccountType&gt;): void ...@@ -1339,9 +1339,9 @@ getOsAccountTypeFromProcess(callback: AsyncCallback&lt;OsAccountType&gt;): void
**示例:** **示例:**
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
accountManager.getOsAccountTypeFromProcess((err, accountType) => { accountManager.getOsAccountTypeFromProcess((err, accountType) => {
console.log("getOsAccountTypeFromProcess err: " + JSON.stringify(err)); console.log('getOsAccountTypeFromProcess err: ' + JSON.stringify(err));
console.log('getOsAccountTypeFromProcess accountType: ' + accountType); console.log('getOsAccountTypeFromProcess accountType: ' + accountType);
}); });
``` ```
...@@ -1363,11 +1363,11 @@ getOsAccountTypeFromProcess(): Promise&lt;OsAccountType&gt; ...@@ -1363,11 +1363,11 @@ getOsAccountTypeFromProcess(): Promise&lt;OsAccountType&gt;
**示例:** **示例:**
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
accountManager.getOsAccountTypeFromProcess().then((accountType) => { accountManager.getOsAccountTypeFromProcess().then((accountType) => {
console.log('getOsAccountTypeFromProcess, accountType: ' + accountType); console.log('getOsAccountTypeFromProcess, accountType: ' + accountType);
}).catch((err) => { }).catch((err) => {
console.log("getOsAccountTypeFromProcess err: " + JSON.stringify(err)); console.log('getOsAccountTypeFromProcess err: ' + JSON.stringify(err));
}); });
``` ```
...@@ -1390,9 +1390,9 @@ getDistributedVirtualDeviceId(callback: AsyncCallback&lt;string&gt;): void ...@@ -1390,9 +1390,9 @@ getDistributedVirtualDeviceId(callback: AsyncCallback&lt;string&gt;): void
**示例:** **示例:**
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
accountManager.getDistributedVirtualDeviceId((err, virtualID) => { accountManager.getDistributedVirtualDeviceId((err, virtualID) => {
console.log("getDistributedVirtualDeviceId err: " + JSON.stringify(err)); console.log('getDistributedVirtualDeviceId err: ' + JSON.stringify(err));
console.log('getDistributedVirtualDeviceId virtualID: ' + virtualID); console.log('getDistributedVirtualDeviceId virtualID: ' + virtualID);
}); });
``` ```
...@@ -1416,11 +1416,11 @@ getDistributedVirtualDeviceId(): Promise&lt;string&gt; ...@@ -1416,11 +1416,11 @@ getDistributedVirtualDeviceId(): Promise&lt;string&gt;
**示例:** **示例:**
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
accountManager.getDistributedVirtualDeviceId().then((virtualID) => { accountManager.getDistributedVirtualDeviceId().then((virtualID) => {
console.log('getDistributedVirtualDeviceId, virtualID: ' + virtualID); console.log('getDistributedVirtualDeviceId, virtualID: ' + virtualID);
}).catch((err) => { }).catch((err) => {
console.log("getDistributedVirtualDeviceId err: " + JSON.stringify(err)); console.log('getDistributedVirtualDeviceId err: ' + JSON.stringify(err));
}); });
``` ```
...@@ -1446,11 +1446,11 @@ getOsAccountProfilePhoto(localId: number, callback: AsyncCallback&lt;string&gt;) ...@@ -1446,11 +1446,11 @@ getOsAccountProfilePhoto(localId: number, callback: AsyncCallback&lt;string&gt;)
**示例:**获取ID为100的系统帐号的头像 **示例:**获取ID为100的系统帐号的头像
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
var localId = 100; let localId = 100;
accountManager.getOsAccountProfilePhoto(localId, (err, photo)=>{ accountManager.getOsAccountProfilePhoto(localId, (err, photo)=>{
console.log("getOsAccountProfilePhoto err:" + JSON.stringify(err)); console.log('getOsAccountProfilePhoto err:' + JSON.stringify(err));
console.log("get photo:" + photo + " by localId: " + localId); console.log('get photo:' + photo + ' by localId: ' + localId);
}); });
``` ```
...@@ -1481,12 +1481,12 @@ getOsAccountProfilePhoto(localId: number): Promise&lt;string&gt; ...@@ -1481,12 +1481,12 @@ getOsAccountProfilePhoto(localId: number): Promise&lt;string&gt;
**示例:**获取ID为100的系统帐号的头像 **示例:**获取ID为100的系统帐号的头像
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
var localId = 100; let localId = 100;
accountManager.getOsAccountProfilePhoto(localId).then((photo) => { accountManager.getOsAccountProfilePhoto(localId).then((photo) => {
console.log("getOsAccountProfilePhoto: " + photo); console.log('getOsAccountProfilePhoto: ' + photo);
}).catch((err) => { }).catch((err) => {
console.log("getOsAccountProfilePhoto err: " + JSON.stringify(err)); console.log('getOsAccountProfilePhoto err: ' + JSON.stringify(err));
}); });
``` ```
...@@ -1513,14 +1513,14 @@ setOsAccountProfilePhoto(localId: number, photo: string, callback: AsyncCallback ...@@ -1513,14 +1513,14 @@ setOsAccountProfilePhoto(localId: number, photo: string, callback: AsyncCallback
**示例:**给ID为100的系统帐号设置头像 **示例:**给ID为100的系统帐号设置头像
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
var localId = 100; let localId = 100;
var photo = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAPCAYAAAA/I0V3AAAAAXNSR0IArs4c6QAAAARnQU1BAA"+ let photo = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAPCAYAAAA/I0V3AAAAAXNSR0IArs4c6QAAAARnQU1BAA'+
"Cxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACwSURBVDhPvZLBDYMwDEV/ugsXRjAT0EHCOuFIBwkbdIRewi6unbiAyoGgSn1SFH85+Y"+ 'Cxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACwSURBVDhPvZLBDYMwDEV/ugsXRjAT0EHCOuFIBwkbdIRewi6unbiAyoGgSn1SFH85+Y'+
"q/4ljARW62X+LHS8uIzjm4dXUYF+utzBikB52Jo5e5iEPKqpACk7R9NM2RvWm5tIkD2czLCUFNKLD6IjdMHFHDzws285MgGrT0xCtp3WOKHo"+ 'q/4ljARW62X+LHS8uIzjm4dXUYF+utzBikB52Jo5e5iEPKqpACk7R9NM2RvWm5tIkD2czLCUFNKLD6IjdMHFHDzws285MgGrT0xCtp3WOKHo'+
"+7q0mP0DZW9pNmoEFUzrQjp5cCnaen2kSJXLFD8ghbXyZCMQf/8e8Ns1XVAG/XAgqKzVnJFAAAAABJRU5ErkJggg==" '+7q0mP0DZW9pNmoEFUzrQjp5cCnaen2kSJXLFD8ghbXyZCMQf/8e8Ns1XVAG/XAgqKzVnJFAAAAABJRU5ErkJggg=='
accountManager.setOsAccountProfilePhoto(localId, photo, (err)=>{ accountManager.setOsAccountProfilePhoto(localId, photo, (err)=>{
console.log("setOsAccountProfilePhoto err:" + JSON.stringify(err)); console.log('setOsAccountProfilePhoto err:' + JSON.stringify(err));
}); });
``` ```
...@@ -1552,16 +1552,16 @@ setOsAccountProfilePhoto(localId: number, photo: string): Promise&lt;void&gt; ...@@ -1552,16 +1552,16 @@ setOsAccountProfilePhoto(localId: number, photo: string): Promise&lt;void&gt;
**示例:**给ID为100的系统帐号设置头像 **示例:**给ID为100的系统帐号设置头像
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
var localId = 100; let localId = 100;
var photo = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAPCAYAAAA/I0V3AAAAAXNSR0IArs4c6QAAAARnQU1BAA"+ let photo = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAPCAYAAAA/I0V3AAAAAXNSR0IArs4c6QAAAARnQU1BAA'+
"Cxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACwSURBVDhPvZLBDYMwDEV/ugsXRjAT0EHCOuFIBwkbdIRewi6unbiAyoGgSn1SFH85+Y"+ 'Cxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACwSURBVDhPvZLBDYMwDEV/ugsXRjAT0EHCOuFIBwkbdIRewi6unbiAyoGgSn1SFH85+Y'+
"q/4ljARW62X+LHS8uIzjm4dXUYF+utzBikB52Jo5e5iEPKqpACk7R9NM2RvWm5tIkD2czLCUFNKLD6IjdMHFHDzws285MgGrT0xCtp3WOKHo"+ 'q/4ljARW62X+LHS8uIzjm4dXUYF+utzBikB52Jo5e5iEPKqpACk7R9NM2RvWm5tIkD2czLCUFNKLD6IjdMHFHDzws285MgGrT0xCtp3WOKHo'+
"+7q0mP0DZW9pNmoEFUzrQjp5cCnaen2kSJXLFD8ghbXyZCMQf/8e8Ns1XVAG/XAgqKzVnJFAAAAABJRU5ErkJggg==" '+7q0mP0DZW9pNmoEFUzrQjp5cCnaen2kSJXLFD8ghbXyZCMQf/8e8Ns1XVAG/XAgqKzVnJFAAAAABJRU5ErkJggg=='
accountManager.setOsAccountProfilePhoto(localId, photo).then(() => { accountManager.setOsAccountProfilePhoto(localId, photo).then(() => {
console.log("setOsAccountProfilePhoto success"); console.log('setOsAccountProfilePhoto success');
}).catch((err) => { }).catch((err) => {
console.log("setOsAccountProfilePhoto err: " + JSON.stringify(err)); console.log('setOsAccountProfilePhoto err: ' + JSON.stringify(err));
}); });
``` ```
...@@ -1583,11 +1583,11 @@ getOsAccountLocalIdBySerialNumber(serialNumber: number, callback: AsyncCallback& ...@@ -1583,11 +1583,11 @@ getOsAccountLocalIdBySerialNumber(serialNumber: number, callback: AsyncCallback&
**示例:**查询与SN码12345关联的系统帐号的ID **示例:**查询与SN码12345关联的系统帐号的ID
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
var serialNumber = 12345; let serialNumber = 12345;
accountManager.getOsAccountLocalIdBySerialNumber(serialNumber, (err, localId)=>{ accountManager.getOsAccountLocalIdBySerialNumber(serialNumber, (err, localId)=>{
console.log("ger localId err:" + JSON.stringify(err)); console.log('ger localId err:' + JSON.stringify(err));
console.log("get localId:" + localId + " by serialNumber: " + serialNumber); console.log('get localId:' + localId + ' by serialNumber: ' + serialNumber);
}); });
``` ```
...@@ -1614,12 +1614,12 @@ getOsAccountLocalIdBySerialNumber(serialNumber: number): Promise&lt;number&gt; ...@@ -1614,12 +1614,12 @@ getOsAccountLocalIdBySerialNumber(serialNumber: number): Promise&lt;number&gt;
**示例:**查询与SN码12345关联的系统帐号的ID **示例:**查询与SN码12345关联的系统帐号的ID
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
var serialNumber = 12345; let serialNumber = 12345;
accountManager.getOsAccountLocalIdBySerialNumber(serialNumber).then((localId) => { accountManager.getOsAccountLocalIdBySerialNumber(serialNumber).then((localId) => {
console.log("getOsAccountLocalIdBySerialNumber localId: " + localId); console.log('getOsAccountLocalIdBySerialNumber localId: ' + localId);
}).catch((err) => { }).catch((err) => {
console.log("getOsAccountLocalIdBySerialNumber err: " + JSON.stringify(err)); console.log('getOsAccountLocalIdBySerialNumber err: ' + JSON.stringify(err));
}); });
``` ```
...@@ -1641,11 +1641,11 @@ getSerialNumberByOsAccountLocalId(localId: number, callback: AsyncCallback&lt;nu ...@@ -1641,11 +1641,11 @@ getSerialNumberByOsAccountLocalId(localId: number, callback: AsyncCallback&lt;nu
**示例:**获取ID为100的系统帐号关联的SN码 **示例:**获取ID为100的系统帐号关联的SN码
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
var localId = 100; let localId = 100;
accountManager.getSerialNumberByOsAccountLocalId(localId, (err, serialNumber)=>{ accountManager.getSerialNumberByOsAccountLocalId(localId, (err, serialNumber)=>{
console.log("ger serialNumber err:" + JSON.stringify(err)); console.log('ger serialNumber err:' + JSON.stringify(err));
console.log("get serialNumber:" + serialNumber + " by localId: " + localId); console.log('get serialNumber:' + serialNumber + ' by localId: ' + localId);
}); });
``` ```
...@@ -1672,12 +1672,12 @@ getSerialNumberByOsAccountLocalId(localId: number): Promise&lt;number&gt; ...@@ -1672,12 +1672,12 @@ getSerialNumberByOsAccountLocalId(localId: number): Promise&lt;number&gt;
**示例:**获取ID为100的系统帐号关联的SN码 **示例:**获取ID为100的系统帐号关联的SN码
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
var localId = 100; let localId = 100;
accountManager.getSerialNumberByOsAccountLocalId(localId).then((serialNumber) => { accountManager.getSerialNumberByOsAccountLocalId(localId).then((serialNumber) => {
console.log("getSerialNumberByOsAccountLocalId serialNumber: " + serialNumber); console.log('getSerialNumberByOsAccountLocalId serialNumber: ' + serialNumber);
}).catch((err) => { }).catch((err) => {
console.log("getSerialNumberByOsAccountLocalId err: " + JSON.stringify(err)); console.log('getSerialNumberByOsAccountLocalId err: ' + JSON.stringify(err));
}); });
``` ```
...@@ -1704,11 +1704,11 @@ on(type: 'activate' | 'activating', name: string, callback: Callback&lt;number&g ...@@ -1704,11 +1704,11 @@ on(type: 'activate' | 'activating', name: string, callback: Callback&lt;number&g
**示例:** **示例:**
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
function onCallback(receiveLocalId){ function onCallback(receiveLocalId){
console.log("receive localId:" + receiveLocalId); console.log('receive localId:' + receiveLocalId);
} }
accountManager.on("activating", "osAccountOnOffNameA", onCallback); accountManager.on('activating', 'osAccountOnOffNameA', onCallback);
``` ```
### off ### off
...@@ -1734,11 +1734,11 @@ off(type: 'activate' | 'activating', name: string, callback?: Callback&lt;number ...@@ -1734,11 +1734,11 @@ off(type: 'activate' | 'activating', name: string, callback?: Callback&lt;number
**示例:** **示例:**
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
function offCallback(){ function offCallback(){
console.log("off enter") console.log('off enter')
} }
accountManager.off("activating", "osAccountOnOffNameA", offCallback); accountManager.off('activating', 'osAccountOnOffNameA', offCallback);
``` ```
### getBundleIdFromUid<sup>9+</sup> ### getBundleIdFromUid<sup>9+</sup>
...@@ -1761,11 +1761,11 @@ getBundleIdFromUid(uid: number, callback: AsyncCallback&lt;number&gt;): void; ...@@ -1761,11 +1761,11 @@ getBundleIdFromUid(uid: number, callback: AsyncCallback&lt;number&gt;): void;
**示例:** **示例:**
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
var testUid = 1000000; let testUid = 1000000;
accountManager.getBundleIdFromUid(testUid, (err, bundleId) => { accountManager.getBundleIdFromUid(testUid, (err, bundleId) => {
console.info("getBundleIdFromUid errInfo:" + JSON.stringify(err)); console.info('getBundleIdFromUid errInfo:' + JSON.stringify(err));
console.info("getBundleIdFromUid bundleId:" + JSON.stringify(bundleId)); console.info('getBundleIdFromUid bundleId:' + JSON.stringify(bundleId));
}); });
``` ```
### getBundleIdFromUid<sup>9+</sup> ### getBundleIdFromUid<sup>9+</sup>
...@@ -1793,12 +1793,12 @@ getBundleIdFromUid(uid: number): Promise&lt;number&gt;; ...@@ -1793,12 +1793,12 @@ getBundleIdFromUid(uid: number): Promise&lt;number&gt;;
**示例:** **示例:**
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
var testUid = 1000000; let testUid = 1000000;
accountManager.getBundleIdFromUid(testUid).then((result) => { accountManager.getBundleIdFromUid(testUid).then((result) => {
console.info("getBundleIdFromUid bundleId:" + JSON.stringify(result)); console.info('getBundleIdFromUid bundleId:' + JSON.stringify(result));
}).catch((err)=>{ }).catch((err)=>{
console.info("getBundleIdFromUid errInfo:" + JSON.stringify(err)); console.info('getBundleIdFromUid errInfo:' + JSON.stringify(err));
}); });
``` ```
...@@ -1823,10 +1823,10 @@ isMainOsAccount(callback: AsyncCallback&lt;boolean&gt;): void; ...@@ -1823,10 +1823,10 @@ isMainOsAccount(callback: AsyncCallback&lt;boolean&gt;): void;
**示例:** **示例:**
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
accountManager.isMainOsAccount((err,result)=>{ accountManager.isMainOsAccount((err,result)=>{
console.info("isMainOsAccount errInfo:" + JSON.stringify(err)); console.info('isMainOsAccount errInfo:' + JSON.stringify(err));
console.info("isMainOsAccount result:" + JSON.stringify(result)); console.info('isMainOsAccount result:' + JSON.stringify(result));
}); });
``` ```
### isMainOsAccount<sup>9+</sup> ### isMainOsAccount<sup>9+</sup>
...@@ -1850,11 +1850,11 @@ isMainOsAccount(): Promise&lt;boolean&gt;; ...@@ -1850,11 +1850,11 @@ isMainOsAccount(): Promise&lt;boolean&gt;;
**示例:** **示例:**
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
accountManager.isMainOsAccount().then((result) => { accountManager.isMainOsAccount().then((result) => {
console.info("isMainOsAccount result:" + JSON.stringify(result)); console.info('isMainOsAccount result:' + JSON.stringify(result));
}).catch((err)=>{ }).catch((err)=>{
console.info("isMainOsAccount errInfo:" + JSON.stringify(err)); console.info('isMainOsAccount errInfo:' + JSON.stringify(err));
}); });
``` ```
### queryOsAccountConstraintSourceTypes<sup>9+</sup> ### queryOsAccountConstraintSourceTypes<sup>9+</sup>
...@@ -1880,10 +1880,10 @@ queryOsAccountConstraintSourceTypes(localId: number, constraint: string, callbac ...@@ -1880,10 +1880,10 @@ queryOsAccountConstraintSourceTypes(localId: number, constraint: string, callbac
**示例:** **示例:**
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
accountManager.queryOsAccountConstraintSourceTypes(100, "constraint.wifi",(err,sourceTypeInfos)=>{ accountManager.queryOsAccountConstraintSourceTypes(100, 'constraint.wifi',(err,sourceTypeInfos)=>{
console.info("queryOsAccountConstraintSourceType errInfo:" + JSON.stringify(err)); console.info('queryOsAccountConstraintSourceType errInfo:' + JSON.stringify(err));
console.info("queryOsAccountConstraintSourceType sourceTypeInfos:" + JSON.stringify(sourceTypeInfos)); console.info('queryOsAccountConstraintSourceType sourceTypeInfos:' + JSON.stringify(sourceTypeInfos));
}); });
``` ```
...@@ -1915,11 +1915,11 @@ queryOsAccountConstraintSourceTypes(localId: number, constraint: string): Promis ...@@ -1915,11 +1915,11 @@ queryOsAccountConstraintSourceTypes(localId: number, constraint: string): Promis
**示例:** **示例:**
```js ```js
const accountManager = account_osAccount.getAccountManager(); let accountManager = account_osAccount.getAccountManager();
accountManager.queryOsAccountConstraintSourceTypes(100, "constraint.wifi").then((result) => { accountManager.queryOsAccountConstraintSourceTypes(100, 'constraint.wifi').then((result) => {
console.info("queryOsAccountConstraintSourceType sourceTypeInfos:" + JSON.stringify(result)); console.info('queryOsAccountConstraintSourceType sourceTypeInfos:' + JSON.stringify(result));
}).catch((err)=>{ }).catch((err)=>{
console.info("queryOsAccountConstraintSourceType errInfo:" + JSON.stringify(err)); console.info('queryOsAccountConstraintSourceType errInfo:' + JSON.stringify(err));
}); });
``` ```
...@@ -1965,7 +1965,7 @@ getVersion(): number; ...@@ -1965,7 +1965,7 @@ getVersion(): number;
```js ```js
let userAuth = new account_osAccount.UserAuth(); let userAuth = new account_osAccount.UserAuth();
let version = userAuth.getVersion(); let version = userAuth.getVersion();
console.log("getVersion version = " + version); console.log('getVersion version = ' + version);
``` ```
### getAvailableStatus<sup>8+</sup> ### getAvailableStatus<sup>8+</sup>
...@@ -1999,7 +1999,7 @@ getAvailableStatus(authType: AuthType, authTrustLevel: AuthTrustLevel): number; ...@@ -1999,7 +1999,7 @@ getAvailableStatus(authType: AuthType, authTrustLevel: AuthTrustLevel): number;
let authType = account_osAccount.AuthType.PIN; let authType = account_osAccount.AuthType.PIN;
let authTrustLevel = account_osAccount.AuthTrustLevel.ATL1; let authTrustLevel = account_osAccount.AuthTrustLevel.ATL1;
let status = userAuth.getAvailableStatus(authType, authTrustLevel); let status = userAuth.getAvailableStatus(authType, authTrustLevel);
console.log("getAvailableStatus status = " + status); console.log('getAvailableStatus status = ' + status);
``` ```
### getProperty<sup>8+</sup> ### getProperty<sup>8+</sup>
...@@ -2034,8 +2034,8 @@ getProperty(request: GetPropertyRequest, callback: AsyncCallback&lt;ExecutorProp ...@@ -2034,8 +2034,8 @@ getProperty(request: GetPropertyRequest, callback: AsyncCallback&lt;ExecutorProp
keys: keys keys: keys
}; };
userAuth.getProperty(request, (err, result) => { userAuth.getProperty(request, (err, result) => {
console.log("getProperty err = " + JSON.stringify(err)); console.log('getProperty err = ' + JSON.stringify(err));
console.log("getProperty result = " + JSON.stringify(result)); console.log('getProperty result = ' + JSON.stringify(result));
}); });
``` ```
...@@ -2076,9 +2076,9 @@ getProperty(request: GetPropertyRequest): Promise&lt;ExecutorProperty&gt;; ...@@ -2076,9 +2076,9 @@ getProperty(request: GetPropertyRequest): Promise&lt;ExecutorProperty&gt;;
keys: keys keys: keys
}; };
userAuth.getProperty(request).then((result) => { userAuth.getProperty(request).then((result) => {
console.log("getProperty result = " + JSON.stringify(result)); console.log('getProperty result = ' + JSON.stringify(result));
}).catch((err) => { }).catch((err) => {
console.log("getProperty error = " + JSON.stringify(err)); console.log('getProperty error = ' + JSON.stringify(err));
}); });
``` ```
...@@ -2110,8 +2110,8 @@ setProperty(request: SetPropertyRequest, callback: AsyncCallback&lt;number&gt;): ...@@ -2110,8 +2110,8 @@ setProperty(request: SetPropertyRequest, callback: AsyncCallback&lt;number&gt;):
setInfo: new Uint8Array([0]) setInfo: new Uint8Array([0])
}; };
userAuth.setProperty(request, (err, result) => { userAuth.setProperty(request, (err, result) => {
console.log("setProperty error = " + JSON.stringify(err)); console.log('setProperty error = ' + JSON.stringify(err));
console.log("setProperty result = " + JSON.stringify(result)); console.log('setProperty result = ' + JSON.stringify(result));
}); });
``` ```
...@@ -2148,9 +2148,9 @@ setProperty(request: SetPropertyRequest): Promise&lt;number&gt;; ...@@ -2148,9 +2148,9 @@ setProperty(request: SetPropertyRequest): Promise&lt;number&gt;;
setInfo: new Uint8Array([0]) setInfo: new Uint8Array([0])
}; };
userAuth.setProperty(request).then((result) => { userAuth.setProperty(request).then((result) => {
console.log("setProperty result = " + JSON.stringify(result)); console.log('setProperty result = ' + JSON.stringify(result));
}).catch((err) => { }).catch((err) => {
console.log("setProperty error = " + JSON.stringify(err)); console.log('setProperty error = ' + JSON.stringify(err));
}); });
``` ```
...@@ -2190,8 +2190,8 @@ auth(challenge: Uint8Array, authType: AuthType, authTrustLevel: AuthTrustLevel, ...@@ -2190,8 +2190,8 @@ auth(challenge: Uint8Array, authType: AuthType, authTrustLevel: AuthTrustLevel,
let authTrustLevel = account_osAccount.AuthTrustLevel.ATL1; let authTrustLevel = account_osAccount.AuthTrustLevel.ATL1;
userAuth.auth(challenge, authType, authTrustLevel, { userAuth.auth(challenge, authType, authTrustLevel, {
onResult: function(result,extraInfo){ onResult: function(result,extraInfo){
console.log("auth result = " + result); console.log('auth result = ' + result);
console.log("auth extraInfo = " + JSON.stringify(extraInfo)); console.log('auth extraInfo = ' + JSON.stringify(extraInfo));
} }
}); });
``` ```
...@@ -2234,8 +2234,8 @@ authUser(userId: number, challenge: Uint8Array, authType: AuthType, authTrustLev ...@@ -2234,8 +2234,8 @@ authUser(userId: number, challenge: Uint8Array, authType: AuthType, authTrustLev
let authTrustLevel = account_osAccount.AuthTrustLevel.ATL1; let authTrustLevel = account_osAccount.AuthTrustLevel.ATL1;
userAuth.authUser(userID, challenge, authType, authTrustLevel, { userAuth.authUser(userID, challenge, authType, authTrustLevel, {
onResult: function(result,extraInfo){ onResult: function(result,extraInfo){
console.log("authUser result = " + result); console.log('authUser result = ' + result);
console.log("authUser extraInfo = " + JSON.stringify(extraInfo)); console.log('authUser extraInfo = ' + JSON.stringify(extraInfo));
} }
}); });
``` ```
...@@ -2271,12 +2271,12 @@ cancelAuth(contextID: Uint8Array): number; ...@@ -2271,12 +2271,12 @@ cancelAuth(contextID: Uint8Array): number;
let challenge = new Uint8Array([0]); let challenge = new Uint8Array([0]);
let contextID = userAuth.auth(challenge, account_osAccount.AuthType.PIN, account_osAccount.AuthTrustLevel.ATL1, { let contextID = userAuth.auth(challenge, account_osAccount.AuthType.PIN, account_osAccount.AuthTrustLevel.ATL1, {
onResult: (result, extraInfo) => { onResult: (result, extraInfo) => {
console.log("auth result = " + result); console.log('auth result = ' + result);
console.log("auth extraInfo = " + JSON.stringify(extraInfo)); console.log('auth extraInfo = ' + JSON.stringify(extraInfo));
} }
}); });
let result = userAuth.cancelAuth(contextID); let result = userAuth.cancelAuth(contextID);
console.log("cancelAuth result = " + result); console.log('cancelAuth result = ' + result);
``` ```
## PINAuth<sup>8+</sup> ## PINAuth<sup>8+</sup>
...@@ -2333,7 +2333,7 @@ registerInputer(inputer: IInputer): boolean; ...@@ -2333,7 +2333,7 @@ registerInputer(inputer: IInputer): boolean;
callback.onSetData(pinSubType, password); callback.onSetData(pinSubType, password);
} }
}); });
console.log("registerInputer result = " + result); console.log('registerInputer result = ' + result);
``` ```
### unregisterInputer ### unregisterInputer
...@@ -2397,8 +2397,8 @@ openSession(callback: AsyncCallback&lt;Uint8Array&gt;): void; ...@@ -2397,8 +2397,8 @@ openSession(callback: AsyncCallback&lt;Uint8Array&gt;): void;
```js ```js
let userIDM = new account_osAccount.UserIdentityManager(); let userIDM = new account_osAccount.UserIdentityManager();
userIDM.openSession((err, challenge) => { userIDM.openSession((err, challenge) => {
console.log("openSession error = " + JSON.stringify(err)); console.log('openSession error = ' + JSON.stringify(err));
console.log("openSession challenge = " + JSON.stringify(challenge)); console.log('openSession challenge = ' + JSON.stringify(challenge));
}); });
``` ```
...@@ -2424,9 +2424,9 @@ openSession(): Promise&lt;Uint8Array&gt;; ...@@ -2424,9 +2424,9 @@ openSession(): Promise&lt;Uint8Array&gt;;
```js ```js
let userIDM = new account_osAccount.UserIdentityManager(); let userIDM = new account_osAccount.UserIdentityManager();
userIDM.openSession().then((challenge) => { userIDM.openSession().then((challenge) => {
console.info("openSession challenge = " + JSON.stringify(challenge)); console.info('openSession challenge = ' + JSON.stringify(challenge));
}).catch((err) => { }).catch((err) => {
console.info("openSession error = " + JSON.stringify(err)); console.info('openSession error = ' + JSON.stringify(err));
}); });
``` ```
...@@ -2467,8 +2467,8 @@ addCredential(credentialInfo: CredentialInfo, callback: IIdmCallback): void; ...@@ -2467,8 +2467,8 @@ addCredential(credentialInfo: CredentialInfo, callback: IIdmCallback): void;
userIDM.openSession((err, challenge) => { userIDM.openSession((err, challenge) => {
userIDM.addCredential(credentialInfo, { userIDM.addCredential(credentialInfo, {
onResult: (result, extraInfo) => { onResult: (result, extraInfo) => {
console.log("updateCredential result = " + result); console.log('updateCredential result = ' + result);
console.log("updateCredential extraInfo = " + extraInfo); console.log('updateCredential extraInfo = ' + extraInfo);
} }
}); });
}); });
...@@ -2518,8 +2518,8 @@ updateCredential(credentialInfo: CredentialInfo, callback: IIdmCallback): void; ...@@ -2518,8 +2518,8 @@ updateCredential(credentialInfo: CredentialInfo, callback: IIdmCallback): void;
credentialInfo.token = extraInfo.token; credentialInfo.token = extraInfo.token;
userIDM.updateCredential(credentialInfo, { userIDM.updateCredential(credentialInfo, {
onResult: (result, extraInfo) => { onResult: (result, extraInfo) => {
console.log("updateCredential result = " + result); console.log('updateCredential result = ' + result);
console.log("updateCredential extraInfo = " + extraInfo); console.log('updateCredential extraInfo = ' + extraInfo);
} }
}); });
} }
...@@ -2574,7 +2574,7 @@ cancel(challenge: Uint8Array): number; ...@@ -2574,7 +2574,7 @@ cancel(challenge: Uint8Array): number;
let userIDM = new account_osAccount.UserIdentityManager(); let userIDM = new account_osAccount.UserIdentityManager();
let challenge = new Uint8Array([0]); let challenge = new Uint8Array([0]);
let result = userIDM.cancel(challenge); let result = userIDM.cancel(challenge);
console.log("cancel result: " + result); console.log('cancel result: ' + result);
``` ```
### delUser<sup>8+</sup> ### delUser<sup>8+</sup>
...@@ -2602,8 +2602,8 @@ delUser(token: Uint8Array, callback: IIdmCallback): void; ...@@ -2602,8 +2602,8 @@ delUser(token: Uint8Array, callback: IIdmCallback): void;
let token = new Uint8Array([0]); let token = new Uint8Array([0]);
userIDM.delUser(token, { userIDM.delUser(token, {
onResult: (result, extraInfo) => { onResult: (result, extraInfo) => {
console.log("delUser result = " + result); console.log('delUser result = ' + result);
console.log("delUser extraInfo = " + JSON.stringify(extraInfo)); console.log('delUser extraInfo = ' + JSON.stringify(extraInfo));
} }
}); });
``` ```
...@@ -2635,8 +2635,8 @@ delCred(credentialId: Uint8Array, token: Uint8Array, callback: IIdmCallback): vo ...@@ -2635,8 +2635,8 @@ delCred(credentialId: Uint8Array, token: Uint8Array, callback: IIdmCallback): vo
let token = new Uint8Array([0]); let token = new Uint8Array([0]);
userIDM.delCred(credentialId, token, { userIDM.delCred(credentialId, token, {
onResult: (result, extraInfo) => { onResult: (result, extraInfo) => {
console.log("delCred result = " + result); console.log('delCred result = ' + result);
console.log("delCred extraInfo = " + JSON.stringify(extraInfo)); console.log('delCred extraInfo = ' + JSON.stringify(extraInfo));
} }
}); });
``` ```
...@@ -2664,8 +2664,8 @@ getAuthInfo(callback: AsyncCallback&lt;Array&lt;EnrolledCredInfo&gt;&gt;): void; ...@@ -2664,8 +2664,8 @@ getAuthInfo(callback: AsyncCallback&lt;Array&lt;EnrolledCredInfo&gt;&gt;): void;
```js ```js
let userIDM = new account_osAccount.UserIdentityManager(); let userIDM = new account_osAccount.UserIdentityManager();
userIDM.getAuthInfo((err, result) => { userIDM.getAuthInfo((err, result) => {
console.log("getAuthInfo err = " + JSON.stringify(err)); console.log('getAuthInfo err = ' + JSON.stringify(err));
console.log("getAuthInfo result = " + JSON.stringify(result)); console.log('getAuthInfo result = ' + JSON.stringify(result));
}); });
``` ```
...@@ -2692,8 +2692,8 @@ getAuthInfo(authType: AuthType, callback: AsyncCallback&lt;Array&lt;EnrolledCred ...@@ -2692,8 +2692,8 @@ getAuthInfo(authType: AuthType, callback: AsyncCallback&lt;Array&lt;EnrolledCred
```js ```js
let userIDM = new account_osAccount.UserIdentityManager(); let userIDM = new account_osAccount.UserIdentityManager();
userIDM.getAuthInfo(account_osAccount.AuthType.PIN, (err, result) => { userIDM.getAuthInfo(account_osAccount.AuthType.PIN, (err, result) => {
console.log("getAuthInfo err = " + JSON.stringify(err)); console.log('getAuthInfo err = ' + JSON.stringify(err));
console.log("getAuthInfo result = " + JSON.stringify(result)); console.log('getAuthInfo result = ' + JSON.stringify(result));
}); });
``` ```
...@@ -2725,9 +2725,9 @@ getAuthInfo(authType?: AuthType): Promise&lt;Array&lt;EnrolledCredInfo&gt;&gt;; ...@@ -2725,9 +2725,9 @@ getAuthInfo(authType?: AuthType): Promise&lt;Array&lt;EnrolledCredInfo&gt;&gt;;
```js ```js
let userIDM = new account_osAccount.UserIdentityManager(); let userIDM = new account_osAccount.UserIdentityManager();
userIDM.getAuthInfo(account_osAccount.AuthType.PIN).then((result) => { userIDM.getAuthInfo(account_osAccount.AuthType.PIN).then((result) => {
console.log("getAuthInfo result = " + JSON.stringify(result)) console.log('getAuthInfo result = ' + JSON.stringify(result))
}).catch((err) => { }).catch((err) => {
console.log("getAuthInfo error = " + JSON.stringify(err)); console.log('getAuthInfo error = ' + JSON.stringify(err));
}); });
``` ```
...@@ -2806,7 +2806,7 @@ onGetData: (pinSubType: AuthSubType, callback: IInputData) => void; ...@@ -2806,7 +2806,7 @@ onGetData: (pinSubType: AuthSubType, callback: IInputData) => void;
}; };
let pinAuth = new account_osAccount.PINAuth(); let pinAuth = new account_osAccount.PINAuth();
let result = pinAuth.registerInputer(inputer); let result = pinAuth.registerInputer(inputer);
console.log("registerInputer result: " + result); console.log('registerInputer result: ' + result);
``` ```
## IUserAuthCallback<sup>8+</sup> ## IUserAuthCallback<sup>8+</sup>
...@@ -2836,8 +2836,8 @@ onResult: (result: number, extraInfo: AuthResult) => void; ...@@ -2836,8 +2836,8 @@ onResult: (result: number, extraInfo: AuthResult) => void;
```js ```js
let authCallback = { let authCallback = {
onResult: (result, extraInfo) => { onResult: (result, extraInfo) => {
console.log("auth result = " + result); console.log('auth result = ' + result);
console.log("auth extraInfo = " + JSON.stringify(extraInfo)); console.log('auth extraInfo = ' + JSON.stringify(extraInfo));
} }
}; };
``` ```
...@@ -2864,12 +2864,12 @@ onAcquireInfo?: (module: number, acquire: number, extraInfo: any) => void; ...@@ -2864,12 +2864,12 @@ onAcquireInfo?: (module: number, acquire: number, extraInfo: any) => void;
```js ```js
let authCallback = { let authCallback = {
onResult: (result, extraInfo) => { onResult: (result, extraInfo) => {
console.log("auth result = " + result) console.log('auth result = ' + result)
console.log("auth extraInfo = " + JSON.stringify(extraInfo)); console.log('auth extraInfo = ' + JSON.stringify(extraInfo));
}, },
onAcquireInfo: (module, acquire, extraInfo) => { onAcquireInfo: (module, acquire, extraInfo) => {
console.log("auth module = " + module); console.log('auth module = ' + module);
console.log("auth acquire = " + acquire); console.log('auth acquire = ' + acquire);
console.info('auth extraInfo = ' + JSON.stringify(extraInfo)); console.info('auth extraInfo = ' + JSON.stringify(extraInfo));
} }
}; };
...@@ -2900,9 +2900,9 @@ onResult: (result: number, extraInfo: RequestResult) => void; ...@@ -2900,9 +2900,9 @@ onResult: (result: number, extraInfo: RequestResult) => void;
**示例:** **示例:**
```js ```js
var idmCallback = { let idmCallback = {
onResult: (result, extraInfo) => { onResult: (result, extraInfo) => {
console.log("callback result = " + result) console.log('callback result = ' + result)
console.info('callback extraInfo = ' + JSON.stringify(extraInfo)); console.info('callback extraInfo = ' + JSON.stringify(extraInfo));
} }
}; };
...@@ -2930,12 +2930,12 @@ onAcquireInfo?: (module: number, acquire: number, extraInfo: any) => void; ...@@ -2930,12 +2930,12 @@ onAcquireInfo?: (module: number, acquire: number, extraInfo: any) => void;
```js ```js
let idmCallback = { let idmCallback = {
onResult: (result, extraInfo) => { onResult: (result, extraInfo) => {
console.log("callback result = " + result) console.log('callback result = ' + result)
console.log("callback onResult = " + JSON.stringify(extraInfo)); console.log('callback onResult = ' + JSON.stringify(extraInfo));
}, },
onAcquireInfo: (module, acquire, extraInfo) => { onAcquireInfo: (module, acquire, extraInfo) => {
console.log("callback module = " + module); console.log('callback module = ' + module);
console.log("callback acquire = " + acquire); console.log('callback acquire = ' + acquire);
console.log('callback onacquireinfo = ' + JSON.stringify(extraInfo)); console.log('callback onacquireinfo = ' + JSON.stringify(extraInfo));
} }
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册