Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
3c4d1aeb
D
Docs
项目概览
OpenHarmony
/
Docs
大约 1 年 前同步成功
通知
159
Star
292
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3c4d1aeb
编写于
1月 06, 2023
作者:
L
lichenchen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add account changelogs
Signed-off-by:
N
lichenchen
<
lichenchen15@huawei.com
>
上级
4da793b5
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
93 addition
and
0 deletion
+93
-0
zh-cn/release-notes/changelogs/OpenHarmony_3.2.10.3/changelogs-account_os_account.md
...ogs/OpenHarmony_3.2.10.3/changelogs-account_os_account.md
+36
-0
zh-cn/release-notes/changelogs/v3.1-Release/changelogs-account_os_account.md
.../changelogs/v3.1-Release/changelogs-account_os_account.md
+57
-0
未找到文件。
zh-cn/release-notes/changelogs/OpenHarmony_3.2.10.3/changelogs-account_os_account.md
0 → 100644
浏览文件 @
3c4d1aeb
# 帐号子系统changeLog
## cl.account_os_account.1 createOsAccountForDomain错误码变更
使用createOsAccountForDomain重复创建域帐号时,变更前返回的错误码为12300001,变更后返回的错误码为12300004。
错误信息由通用系统报错细化为帐号已存在报错。
**变更影响**
基于此前版本开发的应用,需适配变更后的错误码,否则会影响原有业务逻辑。
**关键接口/组件变更**
-
AccountManager
-
createOsAccountForDomain(type: OsAccountType, domainInfo: DomainAccountInfo, callback: AsyncCallback
<
OsAccountInfo
>
);
-
createOsAccountForDomain(type: OsAccountType, domainInfo: DomainAccountInfo): Promise
<
OsAccountInfo
>
;
**适配指导**
重复创建域帐号的示例代码如下:
```
ts
import
account_osAccount
from
"
@ohos.account.osAccount
"
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
let
accountMgr
=
account_osAccount
.
getAccountManager
();
let
domainInfo
=
{
accountName
:
"
zhangsan
"
,
domain
:
"
china.example.com
"
};
try
{
await
accountMgr
.
createOsAccountForDomain
(
account_osAccount
.
OsAccountType
.
NORMAL
,
domainInfo
);
await
accountMgr
.
createOsAccountForDomain
(
account_osAccount
.
OsAccountType
.
NORMAL
,
domainInfo
);
}
catch
(
err
)
{
expect
(
err
.
code
).
assertEqual
(
12300004
);
}
```
zh-cn/release-notes/changelogs/v3.1-Release/changelogs-account_os_account.md
0 → 100644
浏览文件 @
3c4d1aeb
# 帐号子系统changeLog
## cl.account_os_account.1 系统帐号OsAccountInfo.type取值类型变更
变更前,OsAccountInfo.type取值的实际类型为Object,与d.ts中声明的OsAccountType枚举类型不一致;变更后,OsAccountInfo.type取值的实际类型为OsAccountType枚举。
**变更影响**
基于此前版本开发的应用,需变更OsAccountInfo.type值的读取方式,否则影响原因业务逻辑。
**关键接口/组件变更**
涉及的接口:
-
AccountManager
-
queryAllCreatedOsAccounts(callback: AsyncCallback
<
Array
<
OsAccountInfo
>>
): void;
-
queryAllCreatedOsAccounts(): Promise
<
Array
<
OsAccountInfo
>>
;
-
createOsAccount(localName: string, type: OsAccountType, callback: AsyncCallback
<
OsAccountInfo
>
): void;
-
createOsAccount(localName: string, type: OsAccountType): Promise
<
OsAccountInfo
>
;
-
createOsAccountForDomain(type: OsAccountType, domainInfo: DomainAccountInfo, callback: AsyncCallback
<
OsAccountInfo
>
): void;
-
createOsAccountForDomain(type: OsAccountType, domainInfo: DomainAccountInfo): Promise
<
OsAccountInfo
>
;
-
queryCurrentOsAccount(callback: AsyncCallback
<
OsAccountInfo
>
): void;
-
queryCurrentOsAccount(): Promise
<
OsAccountInfo
>
;
-
getCurrentOsAccount(callback: AsyncCallback
<
OsAccountInfo
>
): void;
-
getCurrentOsAccount(): Promise
<
OsAccountInfo
>
;
-
queryOsAccountById(localId: number, callback: AsyncCallback
<
OsAccountInfo
>
): void;
-
queryOsAccountById(localId: number): Promise
<
OsAccountInfo
>
;
-
getOsAccountTypeFromProcess(callback: AsyncCallback
<
OsAccountType
>
): void;
-
getOsAccountTypeFromProcess(): Promise
<
OsAccountType
>
;
-
getOsAccountType(callback: AsyncCallback
<
OsAccountType
>
): void;
-
getOsAccountType(): Promise
<
OsAccountType
>
;
**适配指导**
```
ts
import
account_osAccount
from
"
@ohos.account.osAccount
"
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
let
accountMgr
=
account_osAccount
.
getAccountManager
();
accountMgr
.
createOsAccount
(
'
account_test
'
,
account_osAccount
.
OsAccountType
.
GUEST
).
then
((
accountInfo
)
=>
{
expect
(
accountInfo
.
type
).
assertEqual
(
account_osAccount
.
OsAccountType
.
GUEST
);
accountMgr
.
activateOsAccount
(
accountInfo
.
localId
).
then
(()
=>
{
console
.
log
(
'
activateOsAccount successfully
'
);
accountMgr
.
getOsAccountTypeFromProcess
().
then
((
accountType
)
=>
{
expect
(
accountType
).
assertEqual
(
account_osAccount
.
OsAccountType
.
GUEST
);
}).
catch
((
err
)
=>
{
console
.
log
(
'
activateOsAccount err:
'
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
});
}).
catch
((
err
)
=>
{
console
.
log
(
'
activateOsAccount err:
'
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
});
}).
catch
((
err
)
=>
{
console
.
log
(
'
createOsAccount err:
'
+
JSON
.
stringify
(
err
));
expect
().
assertFail
();
});
```
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录