os.js 762 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. 'use strict';
  2. /**
  3. * 操作系统 - 功能demo
  4. * @class
  5. */
  6. class OsController extends Controller {
  7. constructor(ctx) {
  8. super(ctx);
  9. }
  10. /**
  11. * 所有方法接收两个参数
  12. * @param args 前端传的参数
  13. * @param event - ipc通信时才有值。详情见:控制器文档
  14. */
  15. /**
  16. * test
  17. */
  18. async test () {
  19. const result = await this.service.example.test('electron');
  20. // let tmpDir = Ps.getLogDir();
  21. // Log.info('tmpDir:', tmpDir);
  22. let mid = await Utils.machineIdSync(true);
  23. Log.info('mid 11111111:', mid);
  24. Utils.machineId().then((id) => {
  25. Log.info('mid 222222222:', id);
  26. });
  27. return result;
  28. }
  29. }
  30. OsController.toString = () => '[class OsController]';
  31. module.exports = OsController;