一、环境配置
- 平台硬件: RK3568
- OS版本:OpenHarmony 4.1 Release 32bit(4.1.7.8)
- sdk:API11(full sdk)
- DevEco:4.1.0.400
二、项目介绍
本项目实现了分布式认证,分布式相机预览拍照,分布式图库同步显示删除
三、项目实现注意事项
3.1分布式图库需要基于分布式文件系统实现,分布式文件系统需要预先登录分布式账号
参考 @ohos.account.distributedAccount (分布式帐号管理) (openharmony.cn)
import account_distributedAccount from '@ohos.account.distributedAccount';
import { BusinessError } from '@ohos.base';
/**
* 分布式账号类
* 功能:
* 1.判断是否登录
* 2.登录默认账号
*/
export class distributedAccountHelper {
private distributedAccountAbility: account_distributedAccount.DistributedAccountAbility;
constructor() {
this.distributedAccountAbility = account_distributedAccount.getDistributedAccountAbility();
}
isLogin(): boolean {
let result = false;
this.distributedAccountAbility.getOsAccountDistributedInfo().then((data: account_distributedAccount.DistributedInfo) => {
result = true;