mirror of https://gitee.com/karson/fastadmin.git
优化代码
parent
563596fddc
commit
5e6c32e04c
|
|
@ -20,7 +20,6 @@ use think\Validate;
|
||||||
*/
|
*/
|
||||||
class Ajax extends Backend
|
class Ajax extends Backend
|
||||||
{
|
{
|
||||||
|
|
||||||
protected $noNeedLogin = ['lang'];
|
protected $noNeedLogin = ['lang'];
|
||||||
protected $noNeedRight = ['*'];
|
protected $noNeedRight = ['*'];
|
||||||
protected $layout = '';
|
protected $layout = '';
|
||||||
|
|
@ -195,7 +194,6 @@ class Ajax extends Backend
|
||||||
$type = $this->request->request("type");
|
$type = $this->request->request("type");
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case 'all':
|
case 'all':
|
||||||
// no break
|
|
||||||
case 'content':
|
case 'content':
|
||||||
//内容缓存
|
//内容缓存
|
||||||
rmdirs(CACHE_PATH, false);
|
rmdirs(CACHE_PATH, false);
|
||||||
|
|
@ -203,18 +201,21 @@ class Ajax extends Backend
|
||||||
if ($type == 'content') {
|
if ($type == 'content') {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
// no break
|
||||||
case 'template':
|
case 'template':
|
||||||
// 模板缓存
|
// 模板缓存
|
||||||
rmdirs(TEMP_PATH, false);
|
rmdirs(TEMP_PATH, false);
|
||||||
if ($type == 'template') {
|
if ($type == 'template') {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
// no break
|
||||||
case 'addons':
|
case 'addons':
|
||||||
// 插件缓存
|
// 插件缓存
|
||||||
Service::refresh();
|
Service::refresh();
|
||||||
if ($type == 'addons') {
|
if ($type == 'addons') {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
// no break
|
||||||
case 'browser':
|
case 'browser':
|
||||||
// 浏览器缓存
|
// 浏览器缓存
|
||||||
// 只有生产环境下才修改
|
// 只有生产环境下才修改
|
||||||
|
|
@ -311,5 +312,4 @@ class Ajax extends Backend
|
||||||
$response = Response::create($data, '', 200, $header);
|
$response = Response::create($data, '', 200, $header);
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue