提交 7733302e 编写于 作者: L lihuihui

security

Signed-off-by: Nlihuihui <lihuihui29@huawei.com>
上级 4f4389d0
......@@ -372,6 +372,7 @@ inDevices(devices: Array&lt;string&gt;): RdbPredicates
```js
import deviceManager from '@ohos.distributedHardware.deviceManager';
let dmInstance = null;
let deviceIds = [];
deviceManager.createDeviceManager("com.example.appdatamgrverify", (err, manager) => {
if (err) {
......@@ -380,7 +381,6 @@ deviceManager.createDeviceManager("com.example.appdatamgrverify", (err, manager)
}
dmInstance = manager;
let devices = dmInstance.getTrustedDeviceListSync();
let deviceIds = [];
for (var i = 0; i < devices.length; i++) {
deviceIds[i] = devices[i].deviceId;
}
......@@ -1851,6 +1851,7 @@ obtainDistributedTableName(device: string, table: string, callback: AsyncCallbac
```js
import deviceManager from '@ohos.distributedHardware.deviceManager';
let dmInstance = null;
let deviceId = null;
deviceManager.createDeviceManager("com.example.appdatamgrverify", (err, manager) => {
if (err) {
......@@ -1859,7 +1860,7 @@ deviceManager.createDeviceManager("com.example.appdatamgrverify", (err, manager)
}
dmInstance = manager;
let devices = dmInstance.getTrustedDeviceListSync();
let deviceId = devices[0].deviceId;
deviceId = devices[0].deviceId;
})
......@@ -1904,6 +1905,7 @@ rdbStore.obtainDistributedTableName(deviceId, "EMPLOYEE", function (err, tableNa
```js
import deviceManager from '@ohos.distributedHardware.deviceManager';
let dmInstance = null;
let deviceId = null;
deviceManager.createDeviceManager("com.example.appdatamgrverify", (err, manager) => {
if (err) {
......@@ -1912,7 +1914,7 @@ deviceManager.createDeviceManager("com.example.appdatamgrverify", (err, manager)
}
dmInstance = manager;
let devices = dmInstance.getTrustedDeviceListSync();
let deviceId = devices[0].deviceId;
deviceId = devices[0].deviceId;
})
let promise = rdbStore.obtainDistributedTableName(deviceId, "EMPLOYEE")
......@@ -1946,6 +1948,7 @@ sync(mode: SyncMode, predicates: RdbPredicates, callback: AsyncCallback&lt;Array
```js
import deviceManager from '@ohos.distributedHardware.deviceManager';
let dmInstance = null;
let deviceIds = [];
deviceManager.createDeviceManager("com.example.appdatamgrverify", (err, manager) => {
if (err) {
......@@ -1954,7 +1957,6 @@ deviceManager.createDeviceManager("com.example.appdatamgrverify", (err, manager)
}
dmInstance = manager;
let devices = dmInstance.getTrustedDeviceListSync();
let deviceIds = [];
for (var i = 0; i < devices.length; i++) {
deviceIds[i] = devices[i].deviceId;
}
......@@ -2002,6 +2004,7 @@ rdbStore.sync(data_rdb.SyncMode.SYNC_MODE_PUSH, predicates, function (err, resul
```js
import deviceManager from '@ohos.distributedHardware.deviceManager';
let dmInstance = null;
let deviceIds = [];
deviceManager.createDeviceManager("com.example.appdatamgrverify", (err, manager) => {
if (err) {
......@@ -2010,7 +2013,6 @@ deviceManager.createDeviceManager("com.example.appdatamgrverify", (err, manager)
}
dmInstance = manager;
let devices = dmInstance.getTrustedDeviceListSync();
let deviceIds = [];
for (var i = 0; i < devices.length; i++) {
deviceIds[i] = devices[i].deviceId;
}
......
......@@ -317,6 +317,10 @@ class EntryAbility extends UIAbility {
数据库的安全级别枚举。
> **说明:**
>
> 若需要进行同步操作,数据库安全等级应低于对端设备安全等级。
**系统能力:** SystemCapability.DistributedDataManager.RelationalStore.Core
| 名称 | 值 | 说明 |
......@@ -439,6 +443,7 @@ inDevices(devices: Array&lt;string&gt;): RdbPredicates
```js
import deviceManager from '@ohos.distributedHardware.deviceManager';
let dmInstance = null;
let deviceIds = [];
deviceManager.createDeviceManager("com.example.appdatamgrverify", (err, manager) => {
if (err) {
......@@ -447,7 +452,6 @@ deviceManager.createDeviceManager("com.example.appdatamgrverify", (err, manager)
}
dmInstance = manager;
let devices = dmInstance.getTrustedDeviceListSync();
let deviceIds = [];
for (var i = 0; i < devices.length; i++) {
deviceIds[i] = devices[i].deviceId;
}
......@@ -2048,6 +2052,7 @@ remoteQuery(device: string, table: string, predicates: RdbPredicates, columns: A
```js
import deviceManager from '@ohos.distributedHardware.deviceManager';
let dmInstance = null;
let deviceId = null;
deviceManager.createDeviceManager("com.example.appdatamgrverify", (err, manager) => {
if (err) {
......@@ -2056,7 +2061,7 @@ deviceManager.createDeviceManager("com.example.appdatamgrverify", (err, manager)
}
dmInstance = manager;
let devices = dmInstance.getTrustedDeviceListSync();
let deviceId = devices[0].deviceId;
deviceId = devices[0].deviceId;
})
let predicates = new relationalStore.RdbPredicates('EMPLOYEE');
......@@ -2105,6 +2110,7 @@ remoteQuery(device: string, table: string, predicates: RdbPredicates, columns: A
```js
import deviceManager from '@ohos.distributedHardware.deviceManager';
let dmInstance = null;
let deviceId = null;
deviceManager.createDeviceManager("com.example.appdatamgrverify", (err, manager) => {
if (err) {
......@@ -2113,12 +2119,12 @@ deviceManager.createDeviceManager("com.example.appdatamgrverify", (err, manager)
}
dmInstance = manager;
let devices = dmInstance.getTrustedDeviceListSync();
let deviceId = devices[0].deviceId;
deviceId = devices[0].deviceId;
})
let predicates = new relationalStore.RdbPredicates('EMPLOYEE');
predicates.greaterThan("id", 0);
let promise = store.remoteQuery("deviceId", "EMPLOYEE", predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"]);
let promise = store.remoteQuery(deviceId, "EMPLOYEE", predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"]);
promise.then((resultSet) => {
console.info(`ResultSet column names: ${resultSet.columnNames}`);
console.info(`ResultSet column count: ${resultSet.columnCount}`);
......@@ -2564,6 +2570,7 @@ obtainDistributedTableName(device: string, table: string, callback: AsyncCallbac
```js
import deviceManager from '@ohos.distributedHardware.deviceManager';
let dmInstance = null;
let deviceId = null;
deviceManager.createDeviceManager("com.example.appdatamgrverify", (err, manager) => {
if (err) {
......@@ -2572,7 +2579,7 @@ deviceManager.createDeviceManager("com.example.appdatamgrverify", (err, manager)
}
dmInstance = manager;
let devices = dmInstance.getTrustedDeviceListSync();
let deviceId = devices[0].deviceId;
deviceId = devices[0].deviceId;
})
store.obtainDistributedTableName(deviceId, "EMPLOYEE", function (err, tableName) {
......@@ -2616,6 +2623,7 @@ store.obtainDistributedTableName(deviceId, "EMPLOYEE", function (err, tableName)
```js
import deviceManager from '@ohos.distributedHardware.deviceManager';
let dmInstance = null;
let deviceId = null;
deviceManager.createDeviceManager("com.example.appdatamgrverify", (err, manager) => {
if (err) {
......@@ -2624,7 +2632,7 @@ deviceManager.createDeviceManager("com.example.appdatamgrverify", (err, manager)
}
dmInstance = manager;
let devices = dmInstance.getTrustedDeviceListSync();
let deviceId = devices[0].deviceId;
deviceId = devices[0].deviceId;
})
let promise = store.obtainDistributedTableName(deviceId, "EMPLOYEE");
......@@ -2658,6 +2666,7 @@ sync(mode: SyncMode, predicates: RdbPredicates, callback: AsyncCallback&lt;Array
```js
import deviceManager from '@ohos.distributedHardware.deviceManager';
let dmInstance = null;
let deviceIds = [];
deviceManager.createDeviceManager("com.example.appdatamgrverify", (err, manager) => {
if (err) {
......@@ -2666,7 +2675,6 @@ deviceManager.createDeviceManager("com.example.appdatamgrverify", (err, manager)
}
dmInstance = manager;
let devices = dmInstance.getTrustedDeviceListSync();
let deviceIds = [];
for (var i = 0; i < devices.length; i++) {
deviceIds[i] = devices[i].deviceId;
}
......@@ -2714,6 +2722,7 @@ store.sync(relationalStore.SyncMode.SYNC_MODE_PUSH, predicates, function (err, r
```js
import deviceManager from '@ohos.distributedHardware.deviceManager';
let dmInstance = null;
let deviceIds = [];
deviceManager.createDeviceManager("com.example.appdatamgrverify", (err, manager) => {
if (err) {
......@@ -2722,7 +2731,6 @@ deviceManager.createDeviceManager("com.example.appdatamgrverify", (err, manager)
}
dmInstance = manager;
let devices = dmInstance.getTrustedDeviceListSync();
let deviceIds = [];
for (var i = 0; i < devices.length; i++) {
deviceIds[i] = devices[i].deviceId;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册