1 Star 0 Fork 1.4K

jilongbonew/electron-egg

forked from dromara/electron-egg 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
app.js 1014 Bytes
一键复制 编辑 原始数据 按行查看 历史
哆啦好梦 提交于 2021-02-03 12:26 . 优化存储代码和修改日志
/**
* 全局定义
* @param app
*/
'use strict';
global.CODE = require('./app/const/statusCode');
class AppBootHook {
constructor(app) {
this.app = app;
global.OS_PLATFORM = process.platform;
global.IS_WIN = /^win/.test(process.platform);
}
configWillLoad() {
// Ready to call configDidLoad,
// Config, plugin files are referred,
// this is the last chance to modify the config.
}
configDidLoad() {
// Config, plugin files have been loaded.
}
async didLoad() {
// All files have loaded, start plugin here.
}
async willReady() {
// All plugins have started, can do some thing before app ready
}
async didReady() {
// Worker is ready, can do some things
// don't need to block the app boot.
}
async serverDidReady() {
// Server is listening.
// const storageFile = './storage';
// utils.chmodPath(storageFile, '777');
}
async beforeClose() {
// Do some thing before app close.
}
}
module.exports = AppBootHook;
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/jilongbonew/electron-egg.git
git@gitee.com:jilongbonew/electron-egg.git
jilongbonew
electron-egg
electron-egg
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385