mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
充分配合debug模式清理缓存
This commit is contained in:
parent
a5f3b8cb78
commit
57b6a00437
@ -99,8 +99,9 @@ class Auth extends Controller
|
|||||||
{
|
{
|
||||||
$map = $this->_vali(['auth.require#id' => '权限ID不能为空!']);
|
$map = $this->_vali(['auth.require#id' => '权限ID不能为空!']);
|
||||||
if (input('action') === 'get') {
|
if (input('action') === 'get') {
|
||||||
|
if ($this->app->isDebug()) AdminService::instance()->clearCache();
|
||||||
$checkeds = $this->app->db->name('SystemAuthNode')->where($map)->column('node');
|
$checkeds = $this->app->db->name('SystemAuthNode')->where($map)->column('node');
|
||||||
$this->success('获取权限节点成功!', AdminService::instance()->clearCache()->getTree($checkeds));
|
$this->success('获取权限节点成功!', AdminService::instance()->getTree($checkeds));
|
||||||
} elseif (input('action') === 'save') {
|
} elseif (input('action') === 'save') {
|
||||||
[$post, $data] = [$this->request->post(), []];
|
[$post, $data] = [$this->request->post(), []];
|
||||||
foreach ($post['nodes'] ?? [] as $node) {
|
foreach ($post['nodes'] ?? [] as $node) {
|
||||||
|
@ -36,8 +36,13 @@ class Index extends Controller
|
|||||||
*/
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
$this->login = AdminService::instance()->apply(true)->isLogin();
|
if ($this->app->isDebug()) {
|
||||||
|
AdminService::instance()->apply(true);
|
||||||
|
} else {
|
||||||
|
AdminService::instance()->apply(false);
|
||||||
|
}
|
||||||
$this->menus = MenuService::instance()->getTree();
|
$this->menus = MenuService::instance()->getTree();
|
||||||
|
$this->login = AdminService::instance()->isLogin();
|
||||||
if (empty($this->menus) && empty($this->login)) {
|
if (empty($this->menus) && empty($this->login)) {
|
||||||
$this->redirect(sysuri('admin/login/index'));
|
$this->redirect(sysuri('admin/login/index'));
|
||||||
} else {
|
} else {
|
||||||
|
@ -99,7 +99,9 @@ class Menu extends Controller
|
|||||||
{
|
{
|
||||||
if ($this->request->isGet()) {
|
if ($this->request->isGet()) {
|
||||||
/* 清理权限节点 */
|
/* 清理权限节点 */
|
||||||
AdminService::instance()->clearCache();
|
if ($this->app->isDebug()) {
|
||||||
|
AdminService::instance()->clearCache();
|
||||||
|
}
|
||||||
/* 选择自己的上级菜单 */
|
/* 选择自己的上级菜单 */
|
||||||
$vo['pid'] = $vo['pid'] ?? input('pid', '0');
|
$vo['pid'] = $vo['pid'] ?? input('pid', '0');
|
||||||
/* 读取系统功能节点 */
|
/* 读取系统功能节点 */
|
||||||
|
@ -46,6 +46,7 @@ class Plugs extends Controller
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
if (AdminService::instance()->isSuper()) {
|
if (AdminService::instance()->isSuper()) {
|
||||||
|
AdminService::instance()->clearCache();
|
||||||
SystemService::instance()->pushRuntime();
|
SystemService::instance()->pushRuntime();
|
||||||
$this->success('网站缓存加速成功!');
|
$this->success('网站缓存加速成功!');
|
||||||
} else {
|
} else {
|
||||||
@ -66,6 +67,7 @@ class Plugs extends Controller
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
if (AdminService::instance()->isSuper()) {
|
if (AdminService::instance()->isSuper()) {
|
||||||
|
AdminService::instance()->clearCache();
|
||||||
SystemService::instance()->clearRuntime();
|
SystemService::instance()->clearRuntime();
|
||||||
$this->success('清理网站缓存成功!');
|
$this->success('清理网站缓存成功!');
|
||||||
} else {
|
} else {
|
||||||
|
2
vendor/services.php
vendored
2
vendor/services.php
vendored
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
// This file is automatically generated at:2020-09-29 13:24:31
|
// This file is automatically generated at:2020-09-30 09:44:47
|
||||||
declare (strict_types = 1);
|
declare (strict_types = 1);
|
||||||
return array (
|
return array (
|
||||||
0 => 'think\\admin\\Library',
|
0 => 'think\\admin\\Library',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user