diff --git a/zh-cn/application-dev/reference/apis/js-apis-appAccount.md b/zh-cn/application-dev/reference/apis/js-apis-appAccount.md index f5ca7e2cd9712a68cf9ba285f877d01093d4d592..37b084c3b3e5f2e2cb74e8f4c3f06ba94a3d90e7 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-appAccount.md +++ b/zh-cn/application-dev/reference/apis/js-apis-appAccount.md @@ -64,7 +64,6 @@ createAccount(name: string, callback: AsyncCallback<void>): void; **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); try { appAccountManager.createAccount("WangWu", (err) => { console.log("createAccount err: " + JSON.stringify(err)); @@ -102,7 +101,6 @@ createAccount(name: string, options: CreateAccountOptions, callback: AsyncCallba **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); let options = { customData: { "age": "10" @@ -155,7 +153,6 @@ createAccount(name: string, options?: CreateAccountOptions): Promise<void> **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); let options = { customData: { "age": "10" @@ -215,7 +212,6 @@ createAccountImplicitly(owner: string, callback: AuthCallback): void }); } - let appAccountManager = account_appAccount.createAppAccountManager(); try { appAccountManager.createAccountImplicitly("com.example.accountjsdemo", { onResult: onResultCallback, @@ -270,7 +266,6 @@ createAccountImplicitly(owner: string, options: CreateAccountImplicitlyOptions, }); } - let appAccountManager = account_appAccount.createAppAccountManager(); let options = { authType: "getSocialData", requiredLabels: [ "student" ] @@ -311,7 +306,6 @@ removeAccount(name: string, callback: AsyncCallback<void>): void **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); try { appAccountManager.removeAccount("ZhaoLiu", (err) => { if (err) { @@ -356,7 +350,6 @@ removeAccount(name: string): Promise<void> **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); try { appAccountManager.removeAccount("Lisi").then(() => { console.log("removeAccount successfully"); @@ -397,7 +390,6 @@ setAppAccess(name: string, bundleName: string, isAccessible: boolean, callback: **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); try { appAccountManager.setAppAccess("ZhangSan", "com.example.accountjsdemo", true, (err) => { if (err) { @@ -445,7 +437,6 @@ setAppAccess(name: string, bundleName: string, isAccessible: boolean): Promise&l **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); try { appAccountManager.setAppAccess("ZhangSan", "com.example.accountjsdemo", true).then(() => { console.log("setAppAccess successfully"); @@ -485,7 +476,6 @@ checkAppAccess(name: string, bundleName: string, callback: AsyncCallback<bool **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); try { appAccountManager.checkAppAccess("ZhangSan", "com.example.accountjsdemo", (err, isAccessible) => { if (err) { @@ -532,7 +522,6 @@ checkAppAccess(name: string, bundleName: string): Promise<boolean> **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); try { appAccountManager.checkAppAccess("ZhangSan", "com.example.accountjsdemo").then((isAccessible) => { console.log("checkAppAccess successfully, isAccessible: " + isAccessible); @@ -573,7 +562,6 @@ setDataSyncEnabled(name: string, isEnabled: boolean, callback: AsyncCallback< **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); try { appAccountManager.setDataSyncEnabled("ZhangSan", true, (err) => { console.log("setDataSyncEnabled err: " + JSON.stringify(err)); @@ -617,7 +605,6 @@ setDataSyncEnabled(name: string, isEnabled: boolean): Promise<void> **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); try { appAccountManager .setDataSyncEnabled("ZhangSan", true).then(() => { console.log('setDataSyncEnabled Success'); @@ -657,7 +644,6 @@ checkDataSyncEnabled(name: string, callback: AsyncCallback<boolean>): void **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); try { appAccountManager.checkDataSyncEnabled("ZhangSan", (err, isEnabled) => { if (err) { @@ -704,7 +690,6 @@ checkDataSyncEnabled(name: string): Promise<boolean> **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); try { appAccountManager.checkDataSyncEnabled("ZhangSan").then((isEnabled) => { console.log("checkDataSyncEnabled successfully, isEnabled: " + isEnabled); @@ -744,7 +729,6 @@ setCredential(name: string, credentialType: string, credential: string,callback: **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); try { appAccountManager.setCredential("ZhangSan", "PIN_SIX", "xxxxxx", (err) => { if (err) { @@ -791,7 +775,6 @@ setCredential(name: string, credentialType: string, credential: string): Promise **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); try { appAccountManager.setCredential("ZhangSan", "PIN_SIX", "xxxxxx").then(() => { console.log("setCredential successfully"); @@ -831,7 +814,6 @@ getCredential(name: string, credentialType: string, callback: AsyncCallback<s **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); try { appAccountManager.getCredential("ZhangSan", "PIN_SIX", (err, result) => { if (err) { @@ -878,7 +860,6 @@ getCredential(name: string, credentialType: string): Promise<string> **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); try { appAccountManager.getCredential("ZhangSan", "PIN_SIX").then((credential) => { console.log("getCredential successfully, credential: " + credential); @@ -919,7 +900,6 @@ setCustomData(name: string, key: string, value: string, callback: AsyncCallback& **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); try { appAccountManager.setCustomData("ZhangSan", "age", "12", (err) => { if (err) { @@ -967,7 +947,6 @@ setCustomData(name: string, key: string, value: string): Promise<void> **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); try { appAccountManager.setCustomData("ZhangSan", "age", "12").then(() => { console.log("setCustomData successfully"); @@ -1007,7 +986,6 @@ getCustomData(name: string, key: string, callback: AsyncCallback<string>): **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); try { appAccountManager.getCustomData("ZhangSan", "age", (err, data) => { if (err) { @@ -1054,7 +1032,6 @@ getCustomData(name: string, key: string): Promise<string> **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); try { appAccountManager.getCustomData("ZhangSan", "age").then((data) => { console.log("getCustomData successfully, data: " + data); @@ -1099,7 +1076,6 @@ getCustomDataSync(name: string, key: string): string; **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); try { let value = appAccountManager.getCustomDataSync("ZhangSan", "age"); console.info("getCustomDataSync successfully, vaue:" + value); @@ -1133,7 +1109,6 @@ getAllAccounts(callback: AsyncCallback<Array<AppAccountInfo>>): void **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); try { appAccountManager.getAllAccounts((err, data) => { if (err) { @@ -1172,7 +1147,6 @@ getAllAccounts(): Promise<Array<AppAccountInfo>> **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); try { appAccountManager.getAllAccounts().then((data) => { console.debug("getAllAccounts successfully"); @@ -1212,7 +1186,6 @@ getAccountsByOwner(owner: string, callback: AsyncCallback<Array<AppAccount **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); try { appAccountManager.getAccountsByOwner("com.example.accountjsdemo2", (err, data) => { if (err) { @@ -1259,7 +1232,6 @@ getAccountsByOwner(owner: string): Promise<Array<AppAccountInfo>> **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); try { appAccountManager.getAccountsByOwner("com.example.accountjsdemo2").then((data) => { console.debug("getAccountsByOwner successfully, data:" + JSON.stringify(data)); @@ -1299,7 +1271,6 @@ on(type: 'accountChange', owners: Array<string>, callback: Callback<Arr **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); function changeOnCallback(data){ console.log("receive change data:" + JSON.stringify(data)); } @@ -1336,7 +1307,6 @@ off(type: 'accountChange', callback?: Callback>): void **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); function changeOnCallback(data){ console.log("receive change data:" + JSON.stringify(data)); } @@ -1398,7 +1368,6 @@ auth(name: string, owner: string, authType: string, callback: AuthCallback): voi }); } - let appAccountManager = account_appAccount.createAppAccountManager(); try { appAccountManager.auth("LiSi", "com.example.accountjsdemo", "getSocialData", { onResult: onResultCallback, @@ -1458,7 +1427,6 @@ auth(name: string, owner: string, authType: string, options: {[key: string]: Obj let options = { "password": "xxxx", }; - let appAccountManager = account_appAccount.createAppAccountManager(); try { appAccountManager.auth("LiSi", "com.example.accountjsdemo", "getSocialData", options, { onResult: onResultCallback, @@ -1498,7 +1466,6 @@ getAuthToken(name: string, owner: string, authType: string, callback: AsyncCallb **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); try { appAccountManager.getAuthToken("LiSi", "com.example.accountjsdemo", "getSocialData", (err, token) => { if (err) { @@ -1546,7 +1513,6 @@ getAuthToken(name: string, owner: string, authType: string): Promise<string&g **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); try { appAccountManager.getAuthToken("LiSi", "com.example.accountjsdemo", "getSocialData").then((token) => { console.log("getAuthToken successfully, token: " + token); @@ -1587,7 +1553,6 @@ setAuthToken(name: string, authType: string, token: string, callback: AsyncCallb **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); try { appAccountManager.setAuthToken("LiSi", "getSocialData", "xxxx", (err) => { if (err) { @@ -1635,7 +1600,6 @@ setAuthToken(name: string, authType: string, token: string): Promise<void> **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); try { appAccountManager.setAuthToken("LiSi", "getSocialData", "xxxx").then(() => { console.log("setAuthToken successfully"); @@ -1677,7 +1641,6 @@ deleteAuthToken(name: string, owner: string, authType: string, token: string, ca **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); try { appAccountManager.deleteAuthToken("LiSi", "com.example.accountjsdemo", "getSocialData", "xxxxx", (err) => { if (err) { @@ -1726,7 +1689,6 @@ deleteAuthToken(name: string, owner: string, authType: string, token: string): P **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); try { appAccountManager.deleteAuthToken("LiSi", "com.example.accountjsdemo", "getSocialData", "xxxxx").then(() => { console.log("deleteAuthToken successfully"); @@ -1770,7 +1732,6 @@ setAuthTokenVisibility(name: string, authType: string, bundleName: string, isVis **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); try { appAccountManager.setAuthTokenVisibility("LiSi", "getSocialData", "com.example.accountjsdemo", true, (err) => { if (err) { @@ -1821,7 +1782,6 @@ setAuthTokenVisibility(name: string, authType: string, bundleName: string, isVis **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); try { appAccountManager.setAuthTokenVisibility("LiSi", "getSocialData", "com.example.accountjsdemo", true).then(() => { console.log("setAuthTokenVisibility successfully"); @@ -1863,7 +1823,6 @@ checkAuthTokenVisibility(name: string, authType: string, bundleName: string, cal **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); try { appAccountManager.checkAuthTokenVisibility("LiSi", "getSocialData", "com.example.accountjsdemo", (err, isVisible) => { if (err) { @@ -1912,7 +1871,6 @@ checkAuthTokenVisibility(name: string, authType: string, bundleName: string): Pr **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); try { appAccountManager.checkAuthTokenVisibility("LiSi", "getSocialData", "com.example.accountjsdemo").then((isVisible) => { console.log("checkAuthTokenVisibility successfully, isVisible: " + isVisible); @@ -1951,7 +1909,6 @@ getAllAuthTokens(name: string, owner: string, callback: AsyncCallback<Array&l **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); try { appAccountManager.getAllAuthTokens("LiSi", "com.example.accountjsdemo", (err, tokenArr) => { if (err) { @@ -1997,7 +1954,6 @@ getAllAuthTokens(name: string, owner: string): Promise<Array<AuthTokenInfo **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); try { appAccountManager.getAllAuthTokens("LiSi", "com.example.accountjsdemo").then((tokenArr) => { console.log('getAllAuthTokens successfully, tokenArr: ' + JSON.stringify(tokenArr)); @@ -2037,7 +1993,6 @@ getAuthList(name: string, authType: string, callback: AsyncCallback<Array< **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); try { appAccountManager.getAuthList("com.example.accountjsdemo", "getSocialData", (err, authList) => { if (err) { @@ -2084,7 +2039,6 @@ getAuthList(name: string, authType: string): Promise<Array<string>> **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); try { appAccountManager.getAuthList("com.example.accountjsdemo", "getSocialData").then((authList) => { console.log("getAuthList successfully, authList: " + authList); @@ -2123,7 +2077,6 @@ getAuthCallback(sessionId: string, callback: AsyncCallback<AuthCallback>): ```js import featureAbility from '@ohos.ability.featureAbility'; - let appAccountManager = account_appAccount.createAppAccountManager(); featureAbility.getWant((err, want) => { var sessionId = want.parameters[account_appAccount.Constants.KEY_SESSION_ID]; try { @@ -2183,7 +2136,6 @@ getAuthCallback(sessionId: string): Promise<AuthCallback> ```js import featureAbility from '@ohos.ability.featureAbility'; - let appAccountManager = account_appAccount.createAppAccountManager(); featureAbility.getWant().then((want) => { var sessionId = want.parameters[account_appAccount.Constants.KEY_SESSION_ID]; try { @@ -2236,7 +2188,6 @@ queryAuthenticatorInfo(owner: string, callback: AsyncCallback<AuthenticatorIn **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); try { appAccountManager.queryAuthenticatorInfo("com.example.accountjsdemo", (err, info) => { if (err) { @@ -2281,7 +2232,6 @@ queryAuthenticatorInfo(owner: string): Promise<AuthenticatorInfo> **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); try { appAccountManager.queryAuthenticatorInfo("com.example.accountjsdemo").then((info) => { console.log("queryAuthenticatorInfo successfully, info: " + JSON.stringify(info)); @@ -2324,7 +2274,6 @@ checkAccountLabels(name: string, owner: string, labels: Array<string>, cal **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); let labels = ["student"]; try { appAccountManager.checkAccountLabels("zhangsan", "com.example.accountjsdemo", labels, (err, hasAllLabels) => { @@ -2375,7 +2324,6 @@ checkAccountLabels(name: string, owner: string, labels: Array<string>): Pr **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); let labels = ["student"]; try { appAccountManager.checkAccountLabels("zhangsan", "com.example.accountjsdemo", labels).then((hasAllLabels) => { @@ -2416,7 +2364,6 @@ deleteCredential(name: string, credentialType: string, callback: AsyncCallback&l **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); try { appAccountManager.deleteCredential("zhangsan", "PIN_SIX", (err) => { if (err) { @@ -2463,7 +2410,6 @@ deleteCredential(name: string, credentialType: string): Promise<void> **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); try { appAccountManager.deleteCredential("zhangsan", "PIN_SIX").then(() => { console.log("deleteCredential successfully"); @@ -2502,7 +2448,6 @@ selectAccountsByOptions(options: SelectAccountsOptions, callback: AsyncCallback& **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); let options = { allowedOwners: [ "com.example.accountjsdemo" ], requiredLabels: [ "student" ] @@ -2552,7 +2497,6 @@ selectAccountsByOptions(options: SelectAccountsOptions): Promise<Array<App **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); let options = { allowedOwners: ["com.example.accountjsdemo"] }; @@ -2597,7 +2541,6 @@ verifyCredential(name: string, owner: string, callback: AuthCallback): void; **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); try { appAccountManager.verifyCredential("zhangsan", "com.example.accountjsdemo", { onResult: (resultCode, result) => { @@ -2644,7 +2587,6 @@ verifyCredential(name: string, owner: string, options: VerifyCredentialOptions, **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); let options = { credentialType: "pin", credential: "123456" @@ -2692,7 +2634,6 @@ setAuthenticatorProperties(owner: string, callback: AuthCallback): void; **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); try { appAccountManager.setAuthenticatorProperties("com.example.accountjsdemo", { onResult: (resultCode, result) => { @@ -2737,7 +2678,6 @@ setAuthenticatorProperties(owner: string, options: SetPropertiesOptions, callbac **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); let options = { properties: {"prop1": "value1"} }; @@ -2780,7 +2720,6 @@ addAccount(name: string, callback: AsyncCallback<void>): void **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager.addAccount("WangWu", (err) => { console.log("addAccount err: " + JSON.stringify(err)); }); @@ -2808,7 +2747,6 @@ addAccount(name: string, extraInfo: string, callback: AsyncCallback<void>) **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager.addAccount("LiSi", "token101", (err) => { console.log("addAccount err: " + JSON.stringify(err)); }); @@ -2841,7 +2779,6 @@ addAccount(name: string, extraInfo?: string): Promise<void> **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager.addAccount("LiSi", "token101").then(()=> { console.log('addAccount Success'); }).catch((err) => { @@ -2887,7 +2824,6 @@ addAccountImplicitly(owner: string, authType: string, options: {[key: string]: a }); } - let appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager.addAccountImplicitly("com.example.accountjsdemo", "getSocialData", {}, { onResult: onResultCallback, onRequestRedirected: onRequestRedirectedCallback @@ -2916,7 +2852,6 @@ deleteAccount(name: string, callback: AsyncCallback<void>): void **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager.deleteAccount("ZhaoLiu", (err) => { console.log("deleteAccount err: " + JSON.stringify(err)); }); @@ -2949,7 +2884,6 @@ deleteAccount(name: string): Promise<void> **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager.deleteAccount("ZhaoLiu").then(() => { console.log('deleteAccount Success'); }).catch((err) => { @@ -2979,7 +2913,6 @@ disableAppAccess(name: string, bundleName: string, callback: AsyncCallback<vo **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager.disableAppAccess("ZhangSan", "com.example.accountjsdemo", (err) => { console.log("disableAppAccess err: " + JSON.stringify(err)); }); @@ -3013,7 +2946,6 @@ disableAppAccess(name: string, bundleName: string): Promise<void> **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager.disableAppAccess("ZhangSan", "com.example.accountjsdemo").then(() => { console.log('disableAppAccess Success'); }).catch((err) => { @@ -3044,7 +2976,6 @@ enableAppAccess(name: string, bundleName: string, callback: AsyncCallback<voi **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager.enableAppAccess("ZhangSan", "com.example.accountjsdemo", (err) => { console.log("enableAppAccess: " + JSON.stringify(err)); }); @@ -3078,7 +3009,6 @@ enableAppAccess(name: string, bundleName: string): Promise<void> **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager.enableAppAccess("ZhangSan", "com.example.accountjsdemo").then(() => { console.log('enableAppAccess Success'); }).catch((err) => { @@ -3110,7 +3040,6 @@ checkAppAccountSyncEnable(name: string, callback: AsyncCallback<boolean>): **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager.checkAppAccountSyncEnable("ZhangSan", (err, result) => { console.log("checkAppAccountSyncEnable err: " + JSON.stringify(err)); console.log('checkAppAccountSyncEnable result: ' + result); @@ -3146,7 +3075,6 @@ checkAppAccountSyncEnable(name: string): Promise<boolean> **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager.checkAppAccountSyncEnable("ZhangSan").then((data) => { console.log('checkAppAccountSyncEnable, result: ' + data); }).catch((err) => { @@ -3178,7 +3106,6 @@ setAccountCredential(name: string, credentialType: string, credential: string,ca **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager.setAccountCredential("ZhangSan", "credentialType001", "credential001", (err) => { console.log("setAccountCredential err: " + JSON.stringify(err)); }); @@ -3213,7 +3140,6 @@ setAccountCredential(name: string, credentialType: string, credential: string): **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager.setAccountCredential("ZhangSan", "credentialType001", "credential001").then(() => { console.log('setAccountCredential Success'); }).catch((err) => { @@ -3245,7 +3171,6 @@ setAccountExtraInfo(name: string, extraInfo: string, callback: AsyncCallback< **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager.setAccountExtraInfo("ZhangSan", "Tk002", (err) => { console.log("setAccountExtraInfo err: " + JSON.stringify(err)); }); @@ -3280,7 +3205,6 @@ setAccountExtraInfo(name: string, extraInfo: string): Promise<void> **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager.setAccountExtraInfo("ZhangSan", "Tk002").then(() => { console.log('setAccountExtraInfo Success'); }).catch((err) => { @@ -3313,7 +3237,6 @@ setAppAccountSyncEnable(name: string, isEnable: boolean, callback: AsyncCallback **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager.setAppAccountSyncEnable("ZhangSan", true, (err) => { console.log("setAppAccountSyncEnable err: " + JSON.stringify(err)); }); @@ -3349,7 +3272,6 @@ setAppAccountSyncEnable(name: string, isEnable: boolean): Promise<void> **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager .setAppAccountSyncEnable("ZhangSan", true).then(() => { console.log('setAppAccountSyncEnable Success'); }).catch((err) => { @@ -3382,7 +3304,6 @@ setAssociatedData(name: string, key: string, value: string, callback: AsyncCallb **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager.setAssociatedData("ZhangSan", "k001", "v001", (err) => { console.log("setAssociatedData err: " + JSON.stringify(err)); }); @@ -3418,7 +3339,6 @@ setAssociatedData(name: string, key: string, value: string): Promise<void> **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager.setAssociatedData("ZhangSan", "k001", "v001").then(() => { console.log('setAssociatedData Success'); }).catch((err) => { @@ -3449,7 +3369,6 @@ getAllAccessibleAccounts(callback: AsyncCallback<Array<AppAccountInfo>& **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager.getAllAccessibleAccounts((err, data)=>{ console.debug("getAllAccessibleAccounts err:" + JSON.stringify(err)); console.debug("getAllAccessibleAccounts data:" + JSON.stringify(data)); @@ -3479,7 +3398,6 @@ getAllAccessibleAccounts(): Promise<Array<AppAccountInfo>> **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager.getAllAccessibleAccounts().then((data) => { console.log('getAllAccessibleAccounts: ' + data); }).catch((err) => { @@ -3511,7 +3429,6 @@ getAllAccounts(owner: string, callback: AsyncCallback<Array<AppAccountInfo **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); const selfBundle = "com.example.actsgetallaaccounts"; appAccountManager.getAllAccounts(selfBundle, (err, data)=>{ console.debug("getAllAccounts err:" + JSON.stringify(err)); @@ -3548,7 +3465,6 @@ getAllAccounts(owner: string): Promise<Array<AppAccountInfo>> **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); const selfBundle = "com.example.actsgetallaaccounts"; appAccountManager.getAllAccounts(selfBundle).then((data) => { console.log('getAllAccounts: ' + data); @@ -3580,7 +3496,6 @@ getAccountCredential(name: string, credentialType: string, callback: AsyncCallba **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager.getAccountCredential("ZhangSan", "credentialType001", (err, result) => { console.log("getAccountCredential err: " + JSON.stringify(err)); console.log('getAccountCredential result: ' + result); @@ -3615,7 +3530,6 @@ getAccountCredential(name: string, credentialType: string): Promise<string> **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager.getAccountCredential("ZhangSan", "credentialType001").then((data) => { console.log('getAccountCredential, result: ' + data); }).catch((err) => { @@ -3645,7 +3559,6 @@ getAccountExtraInfo(name: string, callback: AsyncCallback<string>): void **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager.getAccountExtraInfo("ZhangSan", (err, result) => { console.log("getAccountExtraInfo err: " + JSON.stringify(err)); console.log('getAccountExtraInfo result: ' + result); @@ -3679,7 +3592,6 @@ getAccountExtraInfo(name: string): Promise<string> **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager.getAccountExtraInfo("ZhangSan").then((data) => { console.log('getAccountExtraInfo, result: ' + data); }).catch((err) => { @@ -3710,7 +3622,6 @@ getAssociatedData(name: string, key: string, callback: AsyncCallback<string&g **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager.getAssociatedData("ZhangSan", "k001", (err, result) => { console.log("getAssociatedData err: " + JSON.stringify(err)); console.log('getAssociatedData result: ' + result); @@ -3745,7 +3656,6 @@ getAssociatedData(name: string, key: string): Promise<string> **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager.getAssociatedData("ZhangSan", "k001").then((data) => { console.log('getAssociatedData: ' + data); }).catch((err) => { @@ -3776,7 +3686,6 @@ on(type: 'change', owners: Array<string>, callback: Callback<Array<A **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); function changeOnCallback(data){ console.debug("receive change data:" + JSON.stringify(data)); } @@ -3810,7 +3719,6 @@ off(type: 'change', callback?: Callback>): void **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); function changeOnCallback(data){ console.debug("receive change data:" + JSON.stringify(data)); appAccountManager.off('change', function(){ @@ -3864,7 +3772,6 @@ authenticate(name: string, owner: string, authType: string, options: {[key: stri }); } - let appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager.authenticate("LiSi", "com.example.accountjsdemo", "getSocialData", {}, { onResult: onResultCallback, onRequestRedirected: onRequestRedirectedCallback @@ -3895,7 +3802,6 @@ getOAuthToken(name: string, owner: string, authType: string, callback: AsyncCall **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager.getOAuthToken("LiSi", "com.example.accountjsdemo", "getSocialData", (err, data) => { console.log('getOAuthToken err: ' + JSON.stringify(err)); console.log('getOAuthToken token: ' + data); @@ -3931,7 +3837,6 @@ getOAuthToken(name: string, owner: string, authType: string): Promise<string& **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager.getOAuthToken("LiSi", "com.example.accountjsdemo", "getSocialData").then((data) => { console.log('getOAuthToken token: ' + data); }).catch((err) => { @@ -3963,7 +3868,6 @@ setOAuthToken(name: string, authType: string, token: string, callback: AsyncCall **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager.setOAuthToken("LiSi", "getSocialData", "xxxx", (err) => { console.log('setOAuthToken err: ' + JSON.stringify(err)); }); @@ -3998,7 +3902,6 @@ setOAuthToken(name: string, authType: string, token: string): Promise<void> **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager.setOAuthToken("LiSi", "getSocialData", "xxxx").then(() => { console.log('setOAuthToken successfully'); }).catch((err) => { @@ -4031,7 +3934,6 @@ deleteOAuthToken(name: string, owner: string, authType: string, token: string, c **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager.deleteOAuthToken("LiSi", "com.example.accountjsdemo", "getSocialData", "xxxxx", (err) => { console.log('deleteOAuthToken err: ' + JSON.stringify(err)); }); @@ -4067,7 +3969,6 @@ deleteOAuthToken(name: string, owner: string, authType: string, token: string): **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager.deleteOAuthToken("LiSi", "com.example.accountjsdemo", "getSocialData", "xxxxx").then(() => { console.log('deleteOAuthToken successfully'); }).catch((err) => { @@ -4100,7 +4001,6 @@ setOAuthTokenVisibility(name: string, authType: string, bundleName: string, isVi **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager.setOAuthTokenVisibility("LiSi", "getSocialData", "com.example.accountjsdemo", true, (err) => { console.log('setOAuthTokenVisibility err: ' + JSON.stringify(err)); }); @@ -4136,7 +4036,6 @@ setOAuthTokenVisibility(name: string, authType: string, bundleName: string, isVi **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager.setOAuthTokenVisibility("LiSi", "getSocialData", "com.example.accountjsdemo", true).then(() => { console.log('setOAuthTokenVisibility successfully'); }).catch((err) => { @@ -4168,7 +4067,6 @@ checkOAuthTokenVisibility(name: string, authType: string, bundleName: string, ca **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager.checkOAuthTokenVisibility("LiSi", "getSocialData", "com.example.accountjsdemo", (err, data) => { console.log('checkOAuthTokenVisibility err: ' + JSON.stringify(err)); console.log('checkOAuthTokenVisibility isVisible: ' + data); @@ -4204,7 +4102,6 @@ checkOAuthTokenVisibility(name: string, authType: string, bundleName: string): P **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager.checkOAuthTokenVisibility("LiSi", "getSocialData", "com.example.accountjsdemo").then((data) => { console.log('checkOAuthTokenVisibility isVisible: ' + data); }).catch((err) => { @@ -4235,7 +4132,6 @@ getAllOAuthTokens(name: string, owner: string, callback: AsyncCallback<Array& **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager.getAllOAuthTokens("LiSi", "com.example.accountjsdemo", (err, data) => { console.log("getAllOAuthTokens err: " + JSON.stringify(err)); console.log('getAllOAuthTokens data: ' + JSON.stringify(data)); @@ -4270,7 +4166,6 @@ getAllOAuthTokens(name: string, owner: string): Promise<Array<OAuthTokenIn **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager.getAllOAuthTokens("LiSi", "com.example.accountjsdemo").then((data) => { console.log('getAllOAuthTokens data: ' + JSON.stringify(data)); }).catch((err) => { @@ -4301,7 +4196,6 @@ getOAuthList(name: string, authType: string, callback: AsyncCallback<Array< **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager.getOAuthList("com.example.accountjsdemo", "getSocialData", (err, data) => { console.log('getOAuthList err: ' + JSON.stringify(err)); console.log('getOAuthList data: ' + JSON.stringify(data)); @@ -4336,7 +4230,6 @@ getOAuthList(name: string, authType: string): Promise<Array<string>> **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager.getOAuthList("com.example.accountjsdemo", "getSocialData").then((data) => { console.log('getOAuthList data: ' + JSON.stringify(data)); }).catch((err) => { @@ -4367,7 +4260,6 @@ getAuthenticatorCallback(sessionId: string, callback: AsyncCallback<Authentic ```js import featureAbility from '@ohos.ability.featureAbility'; - let appAccountManager = account_appAccount.createAppAccountManager(); featureAbility.getWant((err, want) => { var sessionId = want.parameters[account_appAccount.Constants.KEY_SESSION_ID]; appAccountManager.getAuthenticatorCallback(sessionId, (err, callback) => { @@ -4413,7 +4305,6 @@ getAuthenticatorCallback(sessionId: string): Promise<AuthenticatorCallback> ```js import featureAbility from '@ohos.ability.featureAbility'; - let appAccountManager = account_appAccount.createAppAccountManager(); featureAbility.getWant().then((want) => { var sessionId = want.parameters[account_appAccount.Constants.KEY_SESSION_ID]; appAccountManager.getAuthenticatorCallback(sessionId).then((callback) => { @@ -4452,7 +4343,6 @@ getAuthenticatorInfo(owner: string, callback: AsyncCallback<AuthenticatorInfo **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager.getAuthenticatorInfo("com.example.accountjsdemo", (err, data) => { console.log("getAuthenticatorInfo err: " + JSON.stringify(err)); console.log('getAuthenticatorInfo data: ' + JSON.stringify(data)); @@ -4486,7 +4376,6 @@ getAuthenticatorInfo(owner: string): Promise<AuthenticatorInfo> **示例:** ```js - let appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager.getAuthenticatorInfo("com.example.accountjsdemo").then((data) => { console.log('getAuthenticatorInfo: ' + JSON.stringify(data)); }).catch((err) => {