Files
electron-egg/electron/preload/index.js
哆啦好梦 6e66a0b420 job
2023-03-02 14:17:29 +08:00

47 lines
1.3 KiB
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.
/*************************************************
** preload为预加载模块该文件将会在程序启动时加载 **
*************************************************/
const ChildJob = require('ee-core/module/jobs/child');
const UtilsPs = require('ee-core/module/utils/ps');
const Log = require('ee-core/module/log');
const test = require('./test');
/**
* 预加载模块入口
* @param {Object} app - 全局app对象
*/
module.exports = async (app) => {
//已实现的功能模块,可选择性使用和修改
const trayAddon = app.addon.tray;
const securityAddon = app.addon.security;
const awakenAddon = app.addon.awaken;
const autoUpdaterAddon = app.addon.autoUpdater;
trayAddon.create();
securityAddon.create();
awakenAddon.create();
autoUpdaterAddon.create();
Log.info("[main] process type: ", UtilsPs.processType());
Log.info("[main] process cwd: ", process.cwd());
test();
let myJob = new ChildJob();
//myJob.run('exampleJob', './jobs/example.js');
myJob.run('exampleJob', './jobs/hello.js');
// let opt2 = {
// dev: true,
// type: 'child', // renderer
// path: './jobs/example.js',
// winOptions: {
// show: true
// },
// childOptions: {}
// }
// let myJob2 = new OriginJob();
// myJob2.create('exampleJob2', opt2);
}