mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
修改接口配置
This commit is contained in:
parent
72c6e5b8fd
commit
1eff51022e
@ -38,43 +38,6 @@ class Plugs extends Controller
|
||||
$this->fetch(realpath(__DIR__ . '/../../view/api/icon.html'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 网站压缩发布
|
||||
* @login true
|
||||
*/
|
||||
public function push()
|
||||
{
|
||||
if (AdminService::instance()->isSuper()) try {
|
||||
AdminService::instance()->clearCache();
|
||||
SystemService::instance()->pushRuntime();
|
||||
$this->success('网站缓存加速成功!');
|
||||
} catch (HttpResponseException $exception) {
|
||||
throw $exception;
|
||||
} catch (\Exception $exception) {
|
||||
$this->error($exception->getMessage());
|
||||
} else {
|
||||
$this->error('只有超级管理员才能操作!');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 清理运行缓存
|
||||
* @login true
|
||||
*/
|
||||
public function clear()
|
||||
{
|
||||
if (AdminService::instance()->isSuper()) try {
|
||||
AdminService::instance()->clearCache();
|
||||
SystemService::instance()->clearRuntime();
|
||||
$this->success('清理网站缓存成功!');
|
||||
} catch (HttpResponseException $exception) {
|
||||
throw $exception;
|
||||
} catch (\Exception $exception) {
|
||||
$this->error($exception->getMessage());
|
||||
} else {
|
||||
$this->error('只有超级管理员才能操作!');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 当前运行模式
|
||||
@ -157,4 +120,42 @@ class Plugs extends Controller
|
||||
$this->error('只有超级管理员才能操作!');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 网站压缩发布
|
||||
* @login true
|
||||
*/
|
||||
public function pushRuntime()
|
||||
{
|
||||
if (AdminService::instance()->isSuper()) try {
|
||||
AdminService::instance()->clearCache();
|
||||
SystemService::instance()->pushRuntime();
|
||||
$this->success('网站缓存加速成功!');
|
||||
} catch (HttpResponseException $exception) {
|
||||
throw $exception;
|
||||
} catch (\Exception $exception) {
|
||||
$this->error($exception->getMessage());
|
||||
} else {
|
||||
$this->error('只有超级管理员才能操作!');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 清理运行缓存
|
||||
* @login true
|
||||
*/
|
||||
public function clearRuntime()
|
||||
{
|
||||
if (AdminService::instance()->isSuper()) try {
|
||||
AdminService::instance()->clearCache();
|
||||
SystemService::instance()->clearRuntime();
|
||||
$this->success('清理网站缓存成功!');
|
||||
} catch (HttpResponseException $exception) {
|
||||
throw $exception;
|
||||
} catch (\Exception $exception) {
|
||||
$this->error($exception->getMessage());
|
||||
} else {
|
||||
$this->error('只有超级管理员才能操作!');
|
||||
}
|
||||
}
|
||||
}
|
@ -48,8 +48,8 @@
|
||||
<dd lay-unselect><a data-modal="{:url('admin/index/info',['id'=>session('user.id')])}"><i class="layui-icon layui-icon-set-fill"></i> 基本资料</a></dd>
|
||||
<dd lay-unselect><a data-modal="{:url('admin/index/pass',['id'=>session('user.id')])}"><i class="layui-icon layui-icon-component"></i> 安全设置</a></dd>
|
||||
{if session('user.username') eq 'admin'}
|
||||
<dd lay-unselect><a data-load="{:url('admin/api.plugs/push')}"><i class="layui-icon layui-icon-template-1"></i> 缓存加速</a></dd>
|
||||
<dd lay-unselect><a data-load="{:url('admin/api.plugs/clear')}"><i class="layui-icon layui-icon-fonts-clear"></i> 清理缓存</a></dd>
|
||||
<dd lay-unselect><a data-load="{:url('admin/api.plugs/pushRuntime')}"><i class="layui-icon layui-icon-template-1"></i> 缓存加速</a></dd>
|
||||
<dd lay-unselect><a data-load="{:url('admin/api.plugs/clearRuntime')}"><i class="layui-icon layui-icon-fonts-clear"></i> 清理缓存</a></dd>
|
||||
{/if}
|
||||
<dd lay-unselect><a data-load="{:url('admin/login/out')}" data-confirm="确定要退出登录吗?"><i class="layui-icon layui-icon-release"></i> 退出登录</a></dd>
|
||||
</dl>
|
||||
|
Loading…
x
Reference in New Issue
Block a user