mirror of
https://gitee.com/dromara/electron-egg.git
synced 2026-05-14 19:52:10 +08:00
chore: log
This commit is contained in:
@@ -2,13 +2,14 @@
|
||||
** preload为预加载模块,该文件将会在程序启动时加载 **
|
||||
*************************************************/
|
||||
|
||||
const { logger } = require('ee-core/log');
|
||||
const { trayService } = require('../service/os/tray');
|
||||
const { securityService } = require('../service/os/security');
|
||||
const { autoUpdaterService } = require('../service/os/auto_updater');
|
||||
|
||||
function preload() {
|
||||
// 示例功能模块,可选择性使用和修改
|
||||
console.log('preload functions');
|
||||
logger.info('[preload] load');
|
||||
trayService.create();
|
||||
securityService.create();
|
||||
autoUpdaterService.create();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
const { logger } = require('ee-core/log');
|
||||
const { getConfig } = require('ee-core/config');
|
||||
const { getMainWindow } = require('ee-core/electron');
|
||||
|
||||
@@ -9,23 +10,21 @@ class Lifecycle {
|
||||
* core app have been loaded
|
||||
*/
|
||||
async ready() {
|
||||
// do some things
|
||||
console.log('[lifecycle] ready');
|
||||
logger.info('[lifecycle] ready');
|
||||
}
|
||||
|
||||
/**
|
||||
* electron app ready
|
||||
*/
|
||||
async electronAppReady() {
|
||||
// do some things
|
||||
console.log('[lifecycle] electron-app-ready');
|
||||
logger.info('[lifecycle] electron-app-ready');
|
||||
}
|
||||
|
||||
/**
|
||||
* main window have been loaded
|
||||
*/
|
||||
async windowReady() {
|
||||
console.log('[lifecycle] window-ready');
|
||||
logger.info('[lifecycle] window-ready');
|
||||
// 延迟加载,无白屏
|
||||
const { windowsOption } = getConfig();
|
||||
if (windowsOption.show == false) {
|
||||
@@ -41,11 +40,11 @@ class Lifecycle {
|
||||
* before app close
|
||||
*/
|
||||
async beforeClose() {
|
||||
console.log('[lifecycle] before-close');
|
||||
logger.info('[lifecycle] before-close');
|
||||
}
|
||||
}
|
||||
|
||||
Lifecycle.toString = () => '[class Lifecycle]';
|
||||
|
||||
module.exports = {
|
||||
Lifecycle
|
||||
};
|
||||
@@ -1,28 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es6",
|
||||
"module": "commonjs",
|
||||
"useDefineForClassFields": true,
|
||||
"skipLibCheck": true,
|
||||
"types": ["node"],
|
||||
"esModuleInterop": true,
|
||||
|
||||
/* Bundler mode */
|
||||
"moduleResolution": "node", // node
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
|
||||
/* Linting */
|
||||
"strict": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"noImplicitAny": false,
|
||||
"noImplicitReturns": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
},
|
||||
"include": [
|
||||
"./electron/**/*"
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user