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

!17643 fix demo code problem

Merge pull request !17643 from jidong/dev042501
...@@ -4437,12 +4437,12 @@ auth(domainAccountInfo: DomainAccountInfo, credential: Uint8Array, callback: IUs ...@@ -4437,12 +4437,12 @@ auth(domainAccountInfo: DomainAccountInfo, credential: Uint8Array, callback: IUs
}); });
}, },
authWithPopup: (domainAccountInfo, callback) => {}, authWithPopup: (domainAccountInfo, callback) => {},
authWithToken: (domainAccountInfo, callback) => {}, authWithToken: (domainAccountInfo, token, callback) => {},
getAccountInfo: (domain, accountName, callback) => {}, getAccountInfo: (domain, accountName, callback) => {},
getAuthStatusInfo: (domainAccountInfo, callback) => {}, getAuthStatusInfo: (domainAccountInfo, callback) => {},
bindAccount: (domainAccountInfo, localId, callback) => {}, bindAccount: (domainAccountInfo, localId, callback) => {},
unbindAccount: (domainAccountInfo, callback) => {}, unbindAccount: (domainAccountInfo, callback) => {},
isAccountTokenValid: (domainAccountInfo, callback) => {}, isAccountTokenValid: (domainAccountInfo, token, callback) => {},
getAccessToken: (options, callback) => {} getAccessToken: (options, callback) => {}
} }
account_osAccount.DomainAccountManager.registerPlugin(plugin); account_osAccount.DomainAccountManager.registerPlugin(plugin);
...@@ -4492,12 +4492,12 @@ authWithPopup(domainAccountInfo: DomainAccountInfo, callback: IUserAuthCallback) ...@@ -4492,12 +4492,12 @@ authWithPopup(domainAccountInfo: DomainAccountInfo, callback: IUserAuthCallback)
freezingTime: 0 freezingTime: 0
}); });
}, },
authWithToken: (domainAccountInfo, callback) => {}, authWithToken: (domainAccountInfo, token, callback) => {},
getAccountInfo: (domain, accountName, callback) => {}, getAccountInfo: (domain, accountName, callback) => {},
getAuthStatusInfo: (domainAccountInfo, callback) => {}, getAuthStatusInfo: (domainAccountInfo, callback) => {},
bindAccount: (domainAccountInfo, localId, callback) => {}, bindAccount: (domainAccountInfo, localId, callback) => {},
unbindAccount: (domainAccountInfo, callback) => {}, unbindAccount: (domainAccountInfo, callback) => {},
isAccountTokenValid: (domainAccountInfo, callback) => {}, isAccountTokenValid: (domainAccountInfo, token, callback) => {},
getAccessToken: (options, callback) => {} getAccessToken: (options, callback) => {}
} }
account_osAccount.DomainAccountManager.registerPlugin(plugin) account_osAccount.DomainAccountManager.registerPlugin(plugin)
...@@ -4526,7 +4526,7 @@ authWithToken(domainAccountInfo: DomainAccountInfo, token: Uint8Array, callback: ...@@ -4526,7 +4526,7 @@ authWithToken(domainAccountInfo: DomainAccountInfo, token: Uint8Array, callback:
let plugin = { let plugin = {
auth: (domainAccountInfo, credential, callback) => {}, auth: (domainAccountInfo, credential, callback) => {},
authWithPopup: (domainAccountInfo, callback) => {}, authWithPopup: (domainAccountInfo, callback) => {},
authWithToken: (domainAccountInfo, callback) => { authWithToken: (domainAccountInfo, token, callback) => {
// mock authentication // mock authentication
// notify authentication result // notify authentication result
callback.onResult(0, { callback.onResult(0, {
...@@ -4539,7 +4539,7 @@ authWithToken(domainAccountInfo: DomainAccountInfo, token: Uint8Array, callback: ...@@ -4539,7 +4539,7 @@ authWithToken(domainAccountInfo: DomainAccountInfo, token: Uint8Array, callback:
getAuthStatusInfo: (domainAccountInfo, callback) => {}, getAuthStatusInfo: (domainAccountInfo, callback) => {},
bindAccount: (domainAccountInfo, localId, callback) => {}, bindAccount: (domainAccountInfo, localId, callback) => {},
unbindAccount: (domainAccountInfo, callback) => {}, unbindAccount: (domainAccountInfo, callback) => {},
isAccountTokenValid: (domainAccountInfo, callback) => {}, isAccountTokenValid: (domainAccountInfo, token, callback) => {},
getAccessToken: (options, callback) => {} getAccessToken: (options, callback) => {}
} }
account_osAccount.DomainAccountManager.registerPlugin(plugin) account_osAccount.DomainAccountManager.registerPlugin(plugin)
...@@ -4568,7 +4568,7 @@ getAccountInfo(domain: string, accountName: string, callback: AsyncCallback<D ...@@ -4568,7 +4568,7 @@ getAccountInfo(domain: string, accountName: string, callback: AsyncCallback<D
let plugin = { let plugin = {
auth: (domainAccountInfo, credential, callback) => {}, auth: (domainAccountInfo, credential, callback) => {},
authWithPopup: (domainAccountInfo, callback) => {}, authWithPopup: (domainAccountInfo, callback) => {},
authWithToken: (domainAccountInfo, callback) => {}, authWithToken: (domainAccountInfo, token, callback) => {},
getAccountInfo: (domain, accountName, callback) => { getAccountInfo: (domain, accountName, callback) => {
// mock getting account information // mock getting account information
// notify result // notify result
...@@ -4583,7 +4583,7 @@ getAccountInfo(domain: string, accountName: string, callback: AsyncCallback<D ...@@ -4583,7 +4583,7 @@ getAccountInfo(domain: string, accountName: string, callback: AsyncCallback<D
getAuthStatusInfo: (domainAccountInfo, callback) => {}, getAuthStatusInfo: (domainAccountInfo, callback) => {},
bindAccount: (domainAccountInfo, localId, callback) => {}, bindAccount: (domainAccountInfo, localId, callback) => {},
unbindAccount: (domainAccountInfo, callback) => {}, unbindAccount: (domainAccountInfo, callback) => {},
isAccountTokenValid: (domainAccountInfo, callback) => {}, isAccountTokenValid: (domainAccountInfo, token, callback) => {},
getAccessToken: (options, callback) => {} getAccessToken: (options, callback) => {}
} }
account_osAccount.DomainAccountManager.registerPlugin(plugin) account_osAccount.DomainAccountManager.registerPlugin(plugin)
...@@ -4611,7 +4611,7 @@ getAuthStatusInfo(domainAccountInfo: DomainAccountInfo, callback: AsyncCallback& ...@@ -4611,7 +4611,7 @@ getAuthStatusInfo(domainAccountInfo: DomainAccountInfo, callback: AsyncCallback&
let plugin = { let plugin = {
auth: (domainAccountInfo, credential, callback) => {}, auth: (domainAccountInfo, credential, callback) => {},
authWithPopup: (domainAccountInfo, callback) => {}, authWithPopup: (domainAccountInfo, callback) => {},
authWithToken: (domainAccountInfo, callback) => {}, authWithToken: (domainAccountInfo, token, callback) => {},
getAccountInfo: (domain, accountName, callback) => {}, getAccountInfo: (domain, accountName, callback) => {},
getAuthStatusInfo: (domainAccountInfo, callback) => { getAuthStatusInfo: (domainAccountInfo, callback) => {
callback({ callback({
...@@ -4623,7 +4623,7 @@ getAuthStatusInfo(domainAccountInfo: DomainAccountInfo, callback: AsyncCallback& ...@@ -4623,7 +4623,7 @@ getAuthStatusInfo(domainAccountInfo: DomainAccountInfo, callback: AsyncCallback&
}, },
bindAccount: (domainAccountInfo, localId, callback) => {}, bindAccount: (domainAccountInfo, localId, callback) => {},
unbindAccount: (domainAccountInfo, callback) => {}, unbindAccount: (domainAccountInfo, callback) => {},
isAccountTokenValid: (domainAccountInfo, callback) => {}, isAccountTokenValid: (domainAccountInfo, token, callback) => {},
getAccessToken: (options, callback) => {} getAccessToken: (options, callback) => {}
} }
account_osAccount.DomainAccountManager.registerPlugin(plugin) account_osAccount.DomainAccountManager.registerPlugin(plugin)
...@@ -4651,7 +4651,7 @@ bindAccount(domainAccountInfo: DomainAccountInfo, localId: number, callback: Asy ...@@ -4651,7 +4651,7 @@ bindAccount(domainAccountInfo: DomainAccountInfo, localId: number, callback: Asy
let plugin = { let plugin = {
auth: (domainAccountInfo, credential, callback) => {}, auth: (domainAccountInfo, credential, callback) => {},
authWithPopup: (domainAccountInfo, callback) => {}, authWithPopup: (domainAccountInfo, callback) => {},
authWithToken: (domainAccountInfo, callback) => {}, authWithToken: (domainAccountInfo, token, callback) => {},
getAccountInfo: (domain, accountName, callback) => {}, getAccountInfo: (domain, accountName, callback) => {},
getAuthStatusInfo: (domainAccountInfo, callback) => {}, getAuthStatusInfo: (domainAccountInfo, callback) => {},
bindAccount: (domainAccountInfo, localId, callback) => { bindAccount: (domainAccountInfo, localId, callback) => {
...@@ -4660,7 +4660,7 @@ bindAccount(domainAccountInfo: DomainAccountInfo, localId: number, callback: Asy ...@@ -4660,7 +4660,7 @@ bindAccount(domainAccountInfo: DomainAccountInfo, localId: number, callback: Asy
callback({code: 0}) callback({code: 0})
}, },
unbindAccount: (domainAccountInfo, callback) => {}, unbindAccount: (domainAccountInfo, callback) => {},
isAccountTokenValid: (domainAccountInfo, callback) => {}, isAccountTokenValid: (domainAccountInfo, token, callback) => {},
getAccessToken: (options, callback) => {} getAccessToken: (options, callback) => {}
} }
account_osAccount.DomainAccountManager.registerPlugin(plugin) account_osAccount.DomainAccountManager.registerPlugin(plugin)
...@@ -4688,7 +4688,7 @@ unbindAccount(domainAccountInfo: DomainAccountInfo, callback: AsyncCallback<v ...@@ -4688,7 +4688,7 @@ unbindAccount(domainAccountInfo: DomainAccountInfo, callback: AsyncCallback<v
let plugin = { let plugin = {
auth: (domainAccountInfo, credential, callback) => {}, auth: (domainAccountInfo, credential, callback) => {},
authWithPopup: (domainAccountInfo, callback) => {}, authWithPopup: (domainAccountInfo, callback) => {},
authWithToken: (domainAccountInfo, callback) => {}, authWithToken: (domainAccountInfo, token, callback) => {},
getAccountInfo: (domain, accountName, callback) => {}, getAccountInfo: (domain, accountName, callback) => {},
getAuthStatusInfo: (domainAccountInfo, callback) => {}, getAuthStatusInfo: (domainAccountInfo, callback) => {},
bindAccount: (domainAccountInfo, localId, callback) => {}, bindAccount: (domainAccountInfo, localId, callback) => {},
...@@ -4697,7 +4697,7 @@ unbindAccount(domainAccountInfo: DomainAccountInfo, callback: AsyncCallback<v ...@@ -4697,7 +4697,7 @@ unbindAccount(domainAccountInfo: DomainAccountInfo, callback: AsyncCallback<v
// notify unbinding result // notify unbinding result
callback({code: 0}) callback({code: 0})
}, },
isAccountTokenValid: (domainAccountInfo, callback) => {}, isAccountTokenValid: (domainAccountInfo, token, callback) => {},
getAccessToken: (options, callback) => {} getAccessToken: (options, callback) => {}
} }
account_osAccount.DomainAccountManager.registerPlugin(plugin) account_osAccount.DomainAccountManager.registerPlugin(plugin)
...@@ -4726,12 +4726,12 @@ isAccountTokenValid(domainAccountInfo: DomainAccountInfo, token: Uint8Array, cal ...@@ -4726,12 +4726,12 @@ isAccountTokenValid(domainAccountInfo: DomainAccountInfo, token: Uint8Array, cal
let plugin = { let plugin = {
auth: (domainAccountInfo, credential, callback) => {}, auth: (domainAccountInfo, credential, callback) => {},
authWithPopup: (domainAccountInfo, callback) => {}, authWithPopup: (domainAccountInfo, callback) => {},
authWithToken: (domainAccountInfo, callback) => {}, authWithToken: (domainAccountInfo, token, callback) => {},
getAccountInfo: (domain, accountName, callback) => {}, getAccountInfo: (domain, accountName, callback) => {},
getAuthStatusInfo: (domainAccountInfo, callback) => {}, getAuthStatusInfo: (domainAccountInfo, callback) => {},
bindAccount: (domainAccountInfo, localId, callback) => {}, bindAccount: (domainAccountInfo, localId, callback) => {},
unbindAccount: (domainAccountInfo, callback) => {}, unbindAccount: (domainAccountInfo, callback) => {},
isAccountTokenValid: (domainAccountInfo, callback) => { isAccountTokenValid: (domainAccountInfo, token, callback) => {
// mock checking operation // mock checking operation
// notify checking result // notify checking result
callback({code: 0}, true); callback({code: 0}, true);
...@@ -4763,12 +4763,12 @@ getAccessToken(options: GetDomainAccessTokenOptions, callback: AsyncCallback< ...@@ -4763,12 +4763,12 @@ getAccessToken(options: GetDomainAccessTokenOptions, callback: AsyncCallback<
let plugin = { let plugin = {
auth: (domainAccountInfo, credential, callback) => {}, auth: (domainAccountInfo, credential, callback) => {},
authWithPopup: (domainAccountInfo, callback) => {}, authWithPopup: (domainAccountInfo, callback) => {},
authWithToken: (domainAccountInfo, callback) => {}, authWithToken: (domainAccountInfo, token, callback) => {},
getAccountInfo: (domain, accountName, callback) => {}, getAccountInfo: (domain, accountName, callback) => {},
getAuthStatusInfo: (domainAccountInfo, callback) => {}, getAuthStatusInfo: (domainAccountInfo, callback) => {},
bindAccount: (domainAccountInfo, localId, callback) => {}, bindAccount: (domainAccountInfo, localId, callback) => {},
unbindAccount: (domainAccountInfo, callback) => {}, unbindAccount: (domainAccountInfo, callback) => {},
isAccountTokenValid: (domainAccountInfo, callback) => {}, isAccountTokenValid: (domainAccountInfo, token, callback) => {},
getAccessToken: (options, callback) => { getAccessToken: (options, callback) => {
// mock getting operation // mock getting operation
let token = new Uint8Array([0]); let token = new Uint8Array([0]);
...@@ -4811,11 +4811,13 @@ static registerPlugin(plugin: DomainPlugin): void ...@@ -4811,11 +4811,13 @@ static registerPlugin(plugin: DomainPlugin): void
let plugin = { let plugin = {
auth: (domainAccountInfo, credential, callback) => {}, auth: (domainAccountInfo, credential, callback) => {},
authWithPopup: (domainAccountInfo, callback) => {}, authWithPopup: (domainAccountInfo, callback) => {},
authWithToken: (domainAccountInfo, callback) => {}, authWithToken: (domainAccountInfo, token, callback) => {},
getAccountInfo: (domain, accountName, callback) => {}, getAccountInfo: (domain, accountName, callback) => {},
getAuthStatusInfo: (domainAccountInfo, callback) => {}, getAuthStatusInfo: (domainAccountInfo, callback) => {},
bindAccount: (domainAccountInfo, localId, callback) => {}, bindAccount: (domainAccountInfo, localId, callback) => {},
unbindAccount: (domainAccountInfo, callback) => {} unbindAccount: (domainAccountInfo, callback) => {},
isAccountTokenValid: (domainAccountInfo, token, callback) => {},
getAccessToken: (options, callback) => {}
} }
try { try {
account_osAccount.DomainAccountManager.registerPlugin(plugin); account_osAccount.DomainAccountManager.registerPlugin(plugin);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册