05-关机&重启

使用ShiMetaAPI -sys_setReboot

示例

import shimeta from '@ohos.shimeta';

shimeta.sys_setCommand(`reboot`).then((result: string) => {
  promptAction.showToast({
    message: result
  })
}).catch((error: BusinessError) => {
  Logger.e(TAG, `error code: ${error?.code}, error msg: ${error?.message}`);
})