diff --git a/src/main/resources/core/detect.js b/src/main/resources/core/detect.js index 42e0449..9ad2a6d 100644 --- a/src/main/resources/core/detect.js +++ b/src/main/resources/core/detect.js @@ -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(); \ No newline at end of file diff --git a/src/main/resources/core/init.js b/src/main/resources/core/init.js index 7a467bd..f101e9a 100644 --- a/src/main/resources/core/init.js +++ b/src/main/resources/core/init.js @@ -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 */