修改bug

20240120-ljl-routeConfig
ljl 11 months ago
parent 73473847f7
commit cf3d53cb1e

@ -138,6 +138,44 @@ class HtmlTool {
return $output;
}
public static function getStaticCommonFile($files, $forceTimestamp = '') {
$static = array();
$staticDir = str_replace('\\', '/', Zc::C(ZcConfigConst::DirWsApp));
$apiPath = stripos(Zc::C('static.domain'), '.api.') != false ? '/' : '/api/';
$staticUrlPart = AppConst::getCurProtocol() . '://' . Zc::C('static.domain') . $apiPath . $staticDir . 'views/static_common/';
$files = is_array($files) ? $files : [$files];
foreach ($files as $file) {
$timestamp = '';
list ($file, $timestamp) = explode('?', $file);
$timestamp = empty($timestamp) ? '' : ('?' . $timestamp);
$timestamp = $forceTimestamp ? ('?' . $forceTimestamp) : $timestamp;
$ext = strrchr($file, '.');
$static[$ext][] = $file . $timestamp;
}
$output = '';
foreach ($static as $ext => $files) {
switch (strtolower($ext)) {
case '.css' :
foreach ($files as $f) {
$output .= '<link rel="stylesheet" href="' . $staticUrlPart . 'css/' . $f . '" />' . "\n";
}
break;
case '.js' :
foreach ($files as $f) {
$output .= '<script src="' . $staticUrlPart . 'js/' . $f . '"></script>' . "\n";
}
break;
default :
foreach ($files as $f) {
$output = $staticUrlPart . $f;
}
}
}
return $output;
}
public static function checkIsCloseSidebarMenu() {
$cookieKey = $_SESSION[SessionConst::mallId] . '_getSideBarCookieKey';
return $_COOKIE[$cookieKey] == 'close';

Loading…
Cancel
Save