优化版本设置有效性;优化时间范围和数字范围的placeholder

This commit is contained in:
2022-12-09 16:34:51 +08:00
parent 68dd7c211e
commit 0313d737f6
3 changed files with 5 additions and 28 deletions

View File

@@ -1,22 +0,0 @@
<?php
namespace app\admin\service;
use think\facade\Cache;
class ConfigService
{
public static function getVersion()
{
$version = Cache('version');
if (empty($version)) {
$version = sysconfig('site', 'site_version');
cache('site_version', $version);
Cache::set('version', $version, 3600);
}
return $version;
}
}

View File

@@ -5,7 +5,6 @@
namespace app\common\controller;
use app\admin\model\SystemAdmin;
use app\admin\service\ConfigService;
use app\BaseController;
use app\common\constants\AdminConstant;
use app\common\service\AuthService;
@@ -331,7 +330,7 @@ class AdminController extends BaseController
'thisControllerJsPath' => "{$thisControllerJsPath}",
'autoloadJs' => $autoloadJs,
'isSuperAdmin' => $isSuperAdmin,
'version' => env('app_debug') ? time() : ConfigService::getVersion(),
'version' => env('app_debug') ? time() : sysconfig('site', 'site_version')
];
View::assign($data);