mirror of
https://gitee.com/dromara/electron-egg.git
synced 2026-05-15 12:12:08 +08:00
42 lines
786 B
JavaScript
42 lines
786 B
JavaScript
'use strict';
|
||
|
||
|
||
/**
|
||
* 硬件设备 - 功能demo
|
||
* @class
|
||
*/
|
||
class HardwareController extends Controller {
|
||
|
||
constructor(ctx) {
|
||
super(ctx);
|
||
}
|
||
|
||
/**
|
||
* 所有方法接收两个参数
|
||
* @param args 前端传的参数
|
||
* @param event - ipc通信时才有值。详情见:控制器文档
|
||
*/
|
||
|
||
/**
|
||
* test
|
||
*/
|
||
async test () {
|
||
const result = await this.service.example.test('electron');
|
||
|
||
// let tmpDir = Ps.getLogDir();
|
||
// Log.info('tmpDir:', tmpDir);
|
||
|
||
let mid = await Utils.machineIdSync(true);
|
||
Log.info('mid 11111111:', mid);
|
||
|
||
Utils.machineId().then((id) => {
|
||
Log.info('mid 222222222:', id);
|
||
});
|
||
|
||
return result;
|
||
}
|
||
|
||
}
|
||
|
||
HardwareController.toString = () => '[class HardwareController]';
|
||
module.exports = HardwareController;
|