fix: 修复session、模板页脚页头初始化
This commit is contained in:
@@ -17,6 +17,7 @@ use app\common\library\Email;
|
||||
use app\common\library\Ftp;
|
||||
use think\cache\driver\Memcached;
|
||||
use think\cache\driver\Redis;
|
||||
use think\facade\Cache;
|
||||
use Webman\Event\Event;
|
||||
use app\common\model\system\Attachment;
|
||||
use app\common\model\system\Config;
|
||||
@@ -279,6 +280,7 @@ class Index extends AdminController
|
||||
$config[$key] = $option;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
(new Config())->saveAll($config);
|
||||
$env = base_path() . '/.env';
|
||||
@@ -293,6 +295,12 @@ class Index extends AdminController
|
||||
} catch (\Throwable $th) {
|
||||
return $this->error($th->getMessage());
|
||||
}
|
||||
|
||||
// 清理系统缓存
|
||||
$configList = Cache::get('config_list');
|
||||
foreach ($configList as $item) {
|
||||
Cache::delete($item);
|
||||
}
|
||||
}
|
||||
|
||||
return $this->success('保存成功!');
|
||||
|
||||
@@ -22,6 +22,7 @@ use app\common\model\system\AdminAccess as AdminAccessModel;
|
||||
use think\db\exception\DataNotFoundException;
|
||||
use think\db\exception\DbException;
|
||||
use think\db\exception\ModelNotFoundException;
|
||||
use think\facade\Cache;
|
||||
use Webman\Http\Request;
|
||||
|
||||
/**
|
||||
@@ -541,7 +542,6 @@ class Admin extends AdminController
|
||||
/**
|
||||
* 清理系统缓存
|
||||
* @return \support\Response
|
||||
* @throws \think\Exception
|
||||
*/
|
||||
public function clear(): \support\Response
|
||||
{
|
||||
@@ -553,7 +553,9 @@ class Admin extends AdminController
|
||||
|
||||
// 清理内容
|
||||
if ($type == 'all' || $type == 'content') {
|
||||
$session = session(AdminSession);
|
||||
\think\facade\Cache::clear();
|
||||
request()->session()->set(AdminSession, $session);
|
||||
}
|
||||
|
||||
// 清理模板
|
||||
|
||||
Reference in New Issue
Block a user