fix: server console load error

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
MiaoWoo 2019-04-24 09:25:02 +08:00
parent b611da5e27
commit c2d0c05bcf
2 changed files with 16 additions and 12 deletions

View File

@ -20,14 +20,3 @@ try {
} catch (ex) {
// IGNORE
}
/**
* 尝试加载特殊的Console类
*/
if (DetectServerType) {
try {
load(root + '/internal/' + DetectServerType + '/console.js');
} catch (ex) {
// IGNORE
}
}
global.console = new global.Console();

View File

@ -12,6 +12,7 @@
loadPatch();
loadRequire();
try {
loadServerConsole();
loadServerLib();
loadPlugins();
} catch (ex) {
@ -27,6 +28,7 @@
function loadCore() {
// 加载Console
load(root + '/core/console.js');
global.console = new global.Console();
// 探测服务器类型
load(root + '/core/detect.js');
}
@ -65,6 +67,20 @@
}
}
/**
* 尝试加载特殊的Console类
*/
function loadServerConsole() {
if (DetectServerType) {
try {
requireInternal('console');
global.console = new global.Console();
} catch (ex) {
// IGNORE
}
}
}
/**
* 加载系统类库
*/
@ -100,7 +116,6 @@
}
}
// noinspection JSUnusedLocalSymbols
/**
* 关闭插件Hook
*/