提交 9b057dd8 编写于 作者: F fangyun

update edm doc

Signed-off-by: Nfangyun <fangyun2@huawei.com>
上级 653bbe88
......@@ -131,7 +131,7 @@
- [@ohos.configPolicy (配置策略)](js-apis-config-policy.md)
- [@ohos.enterpriseDeviceManager (企业设备管理)](js-apis-enterprise-device-manager.md)
- [@ohos.EnterpriseAdminExtensionAbility (EnterpriseAdminExtensionAbility)](js-apis-EnterpriseAdminExtensionAbility.md)
- [enterpriseDeviceManager/DeviceSettingsManager(设备设置管理)](js-apis-enterpriseDeviceManager-DeviceSettingsManager.md)
- enterpriseDeviceManager/[DeviceSettingsManager(设备设置管理)](js-apis-enterpriseDeviceManager-DeviceSettingsManager.md)
- 安全
- [@ohos.abilityAccessCtrl (访问控制管理)](js-apis-abilityAccessCtrl.md)
......
......@@ -37,17 +37,22 @@ setDateTime(admin: Want, time: number, callback: AsyncCallback<void>): void
**示例:**
```js
import enterpriseDeviceManager from '@ohos.enterpriseDeviceManager'
let wantTemp = {
bundleName: "bundleName",
abilityName: "abilityName",
};
let deviceSettingsMgr = enterpriseDeviceManager.getDeviceSettingsManager();
deviceSettingsMgr.setDateTime(wantTemp, 1526003846000, (error, value) => {
enterpriseDeviceManager.getDeviceSettingsManager((error, mgr) => {
if (error) {
console.log(error);
} else {
console.log(value);
console.log("error code:" + error.code + " error message:" + error.message);
return;
}
mgr.setDateTime(wantTemp, 1526003846000, (error) => {
if (error) {
console.log("error code:" + error.code + " error message:" + error.message);
}
});
});
```
......@@ -78,14 +83,18 @@ setDateTime(admin: Want, time: number): Promise<void>
**示例:**
```js
import enterpriseDeviceManager from '@ohos.enterpriseDeviceManager'
let wantTemp = {
bundleName: "bundleName",
abilityName: "abilityName",
};
let deviceSettingsMgr = enterpriseDeviceManager.getDeviceSettingsManager();
deviceSettingsMgr.setDateTime(wantTemp, 1526003846000).then((value) => {
console.log(value);
enterpriseDeviceManager.getDeviceSettingsManager().then((mgr) => {
mgr.setDateTime(wantTemp, 1526003846000).then(() => {
}).catch((error) => {
console.log("error code:" + error.code + " error message:" + error.message);
})
}).catch((error) => {
console.log(error);
console.log("error code:" + error.code + " error message:" + error.message);
})
```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册