提交 7977d271 编写于 作者: Y ylq121

xiugai

Signed-off-by: Nylq121 <yangqing89@huawei.com>
上级 dc25a55f
...@@ -56,14 +56,14 @@ static enableCloud(accountId: string, switches: {[bundleName: string]: boolean}, ...@@ -56,14 +56,14 @@ static enableCloud(accountId: string, switches: {[bundleName: string]: boolean},
**示例:** **示例:**
```js ```js
let account = "test_id"; let account = 'test_id';
let switches = { "test_bundleName1": true, "test_bundleName2": false }; let switches = { 'test_bundleName1': true, 'test_bundleName2': false };
try { try {
cloudData.Config.enableCloud(account, switches, function (err) { cloudData.Config.enableCloud(account, switches, function (err) {
if (err === undefined) { if (err === undefined) {
console.info('Succeeded in enabling cloud'); console.info('Succeeded in enabling cloud');
} else { } else {
console.error('Failed to enable.' + `Code: ${err.code}, message: ${err.message}`); console.error(`Failed to enable.Code: ${err.code}, message: ${err.message}`);
} }
}); });
} catch (error) { } catch (error) {
...@@ -99,13 +99,13 @@ static enableCloud(accountId: string, switches: {[bundleName: string]: boolean}) ...@@ -99,13 +99,13 @@ static enableCloud(accountId: string, switches: {[bundleName: string]: boolean})
**示例:** **示例:**
```js ```js
let account = "test_id"; let account = 'test_id';
let switches = { "test_bundleName1": true, "test_bundleName2": false }; let switches = { 'test_bundleName1': true, 'test_bundleName2': false };
try { try {
cloudData.Config.enableCloud(account, switches).then(() => { cloudData.Config.enableCloud(account, switches).then(() => {
console.info('Succeeded in enabling cloud'); console.info('Succeeded in enabling cloud');
}).catch((err) => { }).catch((err) => {
console.error('Failed to enable.' + `Code: ${err.code}, message: ${err.message}`); console.error(`Failed to enable.Code: ${err.code}, message: ${err.message}`);
}); });
} catch (error) { } catch (error) {
console.error(`An unexpected error occurred. Code: ${error.code}, message: ${error.message}`); console.error(`An unexpected error occurred. Code: ${error.code}, message: ${error.message}`);
...@@ -134,13 +134,13 @@ static disableCloud(accountId: string, callback: AsyncCallback&lt;void&gt;):void ...@@ -134,13 +134,13 @@ static disableCloud(accountId: string, callback: AsyncCallback&lt;void&gt;):void
**示例:** **示例:**
```js ```js
let account = "test_id"; let account = 'test_id';
try { try {
cloudData.Config.disableCloud(account, function (err) { cloudData.Config.disableCloud(account, function (err) {
if (err === undefined) { if (err === undefined) {
console.info('Succeeded in disabling cloud'); console.info('Succeeded in disabling cloud');
} else { } else {
console.error('Failed to disableCloud.' + `Code: ${err.code}, message: ${err.message}`); console.error(`Failed to disableCloud. Code: ${err.code}, message: ${err.message}`);
} }
}); });
} catch (error) { } catch (error) {
...@@ -175,13 +175,12 @@ static disableCloud(accountId: string): Promise&lt;void&gt; ...@@ -175,13 +175,12 @@ static disableCloud(accountId: string): Promise&lt;void&gt;
**示例:** **示例:**
```js ```js
let account = "test_id"; let account = 'test_id';
let switches = { "test_bundleName1": true, "test_bundleName2": false };
try { try {
cloudData.Config.disableCloud(account).then(() => { cloudData.Config.disableCloud(account).then(() => {
console.info('Succeeded in disabling cloud'); console.info('Succeeded in disabling cloud');
}).catch((err) => { }).catch((err) => {
console.error('Failed to disableCloud.' + `Code: ${err.code}, message: ${err.message}`); console.error(`Failed to disableCloud. Code: ${err.code}, message: ${err.message}`);
}); });
} catch (error) { } catch (error) {
console.error(`An unexpected error occurred. Code: ${error.code}, message: ${error.message}`); console.error(`An unexpected error occurred. Code: ${error.code}, message: ${error.message}`);
...@@ -212,14 +211,14 @@ static changeAppCloudSwitch(accountId: string,bundleName:string,status:boolean, ...@@ -212,14 +211,14 @@ static changeAppCloudSwitch(accountId: string,bundleName:string,status:boolean,
**示例:** **示例:**
```js ```js
let account = "test_id"; let account = 'test_id';
let bundleName = "test_bundleName"; let bundleName = 'test_bundleName';
try { try {
cloudData.Config.changeAppCloudSwitch(account, bundleName, true, function (err) { cloudData.Config.changeAppCloudSwitch(account, bundleName, true, function (err) {
if (err === undefined) { if (err === undefined) {
console.info('Succeeded in changing App cloud switch'); console.info('Succeeded in changing App cloud switch');
} else { } else {
console.error('Failed to change App cloud switch.' + `Code: ${err.code}, message: ${err.message}`); console.error(`Failed to change App cloud switch. Code: ${err.code}, message: ${err.message}`);
} }
}); });
} catch (error) { } catch (error) {
...@@ -256,13 +255,13 @@ static changeAppCloudSwitch(accountId: string,bundleName:string,status:boolean): ...@@ -256,13 +255,13 @@ static changeAppCloudSwitch(accountId: string,bundleName:string,status:boolean):
**示例:** **示例:**
```js ```js
let account = "test_id"; let account = 'test_id';
let bundleName = "test_bundleName"; let bundleName = 'test_bundleName';
try { try {
cloudData.Config.changeAppCloudSwitch(account, bundleName, true).then(() => { cloudData.Config.changeAppCloudSwitch(account, bundleName, true).then(() => {
console.info('Succeeded in changing App cloud switch'); console.info('Succeeded in changing App cloud switch');
}).catch((err) => { }).catch((err) => {
console.error('Failed to change App cloud switch.' + `Code is ${err.code}, message is ${err.message}`); console.error(`Failed to change App cloud switch. Code is ${err.code}, message is ${err.message}`);
}); });
} catch (error) { } catch (error) {
console.error(`An unexpected error occurred. Code: ${error.code}, message: ${error.message}`); console.error(`An unexpected error occurred. Code: ${error.code}, message: ${error.message}`);
...@@ -292,14 +291,14 @@ static notifyDataChange(accountId: string,bundleName:string, callback: AsyncCall ...@@ -292,14 +291,14 @@ static notifyDataChange(accountId: string,bundleName:string, callback: AsyncCall
**示例:** **示例:**
```js ```js
let account = "test_id"; let account = 'test_id';
let bundleName = "test_bundleName"; let bundleName = 'test_bundleName';
try { try {
cloudData.Config.notifyDataChange(account, bundleName, function (err) { cloudData.Config.notifyDataChange(account, bundleName, function (err) {
if (err === undefined) { if (err === undefined) {
console.info('Succeeded in notifying the change of data'); console.info('Succeeded in notifying the change of data');
} else { } else {
console.error('Failed to notify the change of data.' + `Code: ${err.code}, message: ${err.message}`); console.error(`Failed to notify the change of data. Code: ${err.code}, message: ${err.message}`);
} }
}); });
} catch (error) { } catch (error) {
...@@ -335,13 +334,13 @@ static notifyDataChange(accountId: string,bundleName:string): Promise&lt;void&gt ...@@ -335,13 +334,13 @@ static notifyDataChange(accountId: string,bundleName:string): Promise&lt;void&gt
**示例:** **示例:**
```js ```js
let account = "test_id"; let account = 'test_id';
let bundleName = "test_bundleName"; let bundleName = 'test_bundleName';
try { try {
cloudData.Config.notifyDataChange(account, bundleName).then(() => { cloudData.Config.notifyDataChange(account, bundleName).then(() => {
console.info('Succeeded in notifying the change of data'); console.info('Succeeded in notifying the change of data');
}).catch((err) => { }).catch((err) => {
console.error('Failed to notify the change of data.' + `Code: ${err.code}, message: ${err.message}`); console.error(`Failed to notify the change of data. Code: ${err.code}, message: ${err.message}`);
}); });
} catch (error) { } catch (error) {
console.error(`An unexpected error occurred. Code: ${error.code}, message: ${error.message}`); console.error(`An unexpected error occurred. Code: ${error.code}, message: ${error.message}`);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册