diff --git a/www/js/zui3/zin.js b/www/js/zui3/zin.js index 7ed0bc23d5..3ac4a53868 100644 --- a/www/js/zui3/zin.js +++ b/www/js/zui3/zin.js @@ -1,6 +1,8 @@ (function() { - let DEBUG = true; + const config = window.config; + const DEBUG = config.debug; + const isIndexPage = config.currentModule === 'index' && (config.currentMethod === 'index' || config.currentMethod === 'index2'); const currentCode = window.name.substring(4); const isInAppTab = parent.window !== window; const fetchTasks = new Map(); @@ -52,7 +54,7 @@ function initZinbar() { - if(!DEBUG) return; + if(!DEBUG || isIndexPage) return; let $bar = $('#zinbar'); if($bar.length) return; @@ -77,6 +79,7 @@ function updatePerfInfo(options, stage, error) { + if(!DEBUG || isIndexPage) return; options[stage] = performance.now(); const $perf = options.id === 'page' ? $('#pagePerf') : $('#partPerf'); if(stage === 'requestBegin') @@ -522,8 +525,6 @@ if(window.defaultAppUrl) loadPage(window.defaultAppUrl); else if(DEBUG) loadCurrentPage('zinErrors()'); - DEBUG = window.config.debug; - /* Compatible with old version */ if(DEBUG && typeof window.zin !== 'object' && isInAppTab) { diff --git a/zin/wg/pagebase/v1.php b/zin/wg/pagebase/v1.php index cbfcbb8630..ffd3043f15 100644 --- a/zin/wg/pagebase/v1.php +++ b/zin/wg/pagebase/v1.php @@ -72,13 +72,13 @@ class pageBase extends wg $this->block('headBefore'), $zui ? h::importCss($config->zin->zuiPath . 'zui.zentao.css', set::id('zuiCSS')) : null, $zui ? h::importJs($config->zin->zuiPath . 'zui.zentao.umd.cjs', set::id('zuiJS')) : null, + h::jsVar('window.config', $jsConfig, set::id('configJS')), $zui ? h::importJs($app->getWebRoot() . 'js/zui3/zin.js', set::id('zinJS')) : null, $head, ), h::body ( empty($imports) ? NULL : h::import($imports), - h::jsVar('window.config', $jsConfig, set::id('configJS')), set($bodyProps), set::class($bodyClass), empty($css) ? NULL : h::css($css, set::id('pageCSS')),