Files
electron-egg/electron/controller/example.js
哆啦好梦 fd3cd5cfdb example
2023-05-16 14:00:37 +08:00

37 lines
669 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
'use strict';
const { Controller } = require('ee-core');
const Log = require('ee-core/log');
/**
* example
* @class
*/
class ExampleController 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);
return result;
}
}
ExampleController.toString = () => '[class ExampleController]';
module.exports = ExampleController;