新增关系型数据库本地变更通知

Signed-off-by: sunlian <sunlian@kaihong.com>
This commit is contained in:
sunlian 2024-06-03 16:55:10 +08:00
parent b95d5d1103
commit 6d0a37b995
2 changed files with 3 additions and 2 deletions

View File

@ -66,6 +66,7 @@ struct Index {
async aboutToAppear() {
Logger.info(TAG, 'aboutToAppear')
await this.rdbModel.getRdbStore();
await this.getData();
this.rdbModel.onDataChangeDetail(this.state.distributedDevice, (result: Array<Contact>) => {
this.showDataChangeDialog(result)
})
@ -113,7 +114,7 @@ struct Index {
async onPageShow() {
try {
// 初始化分部署数据库
//await this.rdbModel.getRdbStore()
await this.rdbModel.getRdbStore()
this.intervalId = setInterval(() => {
// 手动侦听应用被拉起的动作
this.getWant()

View File

@ -50,7 +50,7 @@
],
"requestPermissions": [
{
"name": "ohos.permission.DISTRIBUTED_DATASYNC",
"name": "ohos.permission.DISTRIBUTED_DATASYNC"
},
{
"name": "ohos.permission.ACCESS_SERVICE_DM"