mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
增加网站缓存处理
This commit is contained in:
parent
d4f6b04ebb
commit
4b5c6d3316
@ -18,6 +18,7 @@ namespace app\admin\controller;
|
|||||||
use think\admin\Controller;
|
use think\admin\Controller;
|
||||||
use think\admin\service\AdminService;
|
use think\admin\service\AdminService;
|
||||||
use think\admin\service\MenuService;
|
use think\admin\service\MenuService;
|
||||||
|
use think\exception\HttpResponseException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 后台界面入口
|
* 后台界面入口
|
||||||
@ -110,4 +111,37 @@ class Index extends Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网站压缩发布
|
||||||
|
* @login true
|
||||||
|
*/
|
||||||
|
public function optimize()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$this->app->console->call('optimize:route');
|
||||||
|
$this->app->console->call('optimize:schema');
|
||||||
|
$this->success('网站压缩加速成功!');
|
||||||
|
} catch (HttpResponseException $exception) {
|
||||||
|
throw $exception;
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$this->error($e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清理运行缓存
|
||||||
|
* @login true
|
||||||
|
*/
|
||||||
|
public function clear()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$this->app->console->call('clear');
|
||||||
|
$this->success('清理网站缓存成功!');
|
||||||
|
} catch (HttpResponseException $exception) {
|
||||||
|
throw $exception;
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$this->error($e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -58,6 +58,12 @@
|
|||||||
<i class="layui-icon layui-icon-component margin-right-5"></i> 安全设置
|
<i class="layui-icon layui-icon-component margin-right-5"></i> 安全设置
|
||||||
</a>
|
</a>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dd lay-unselect>
|
||||||
|
<a data-modal="{:url('admin/index/optimize')}"><i class="layui-icon layui-icon-template-1 margin-right-5"></i>缓存加速</a>
|
||||||
|
</dd>
|
||||||
|
<dd lay-unselect>
|
||||||
|
<a data-modal="{:url('admin/index/clear')}"><i class="layui-icon layui-icon-fonts-clear margin-right-5"></i>清理缓存</a>
|
||||||
|
</dd>
|
||||||
<dd lay-unselect>
|
<dd lay-unselect>
|
||||||
<a data-load="{:url('admin/login/out')}" data-confirm="确定要退出登录吗?">
|
<a data-load="{:url('admin/login/out')}" data-confirm="确定要退出登录吗?">
|
||||||
<i class="layui-icon layui-icon-release margin-right-5"></i> 退出登录
|
<i class="layui-icon layui-icon-release margin-right-5"></i> 退出登录
|
||||||
|
@ -746,8 +746,6 @@ $(function () {
|
|||||||
this.value = (parseFloat(this.value) || 0).toFixed(fiexd);
|
this.value = (parseFloat(this.value) || 0).toFixed(fiexd);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*! 图片加载异常处理 */
|
/*! 图片加载异常处理 */
|
||||||
document.addEventListener('error', function (e, elem) {
|
document.addEventListener('error', function (e, elem) {
|
||||||
elem = e.target;
|
elem = e.target;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user