update:优化部分代码

This commit is contained in:
JaguarJack
2021-02-08 11:26:54 +08:00
parent 61ecd0629f
commit 706410480b
3 changed files with 67 additions and 63 deletions

View File

@@ -17,7 +17,7 @@ class Module extends CatchController
*
* @return Json
*/
public function index()
public function index(): Json
{
$modules = [];
@@ -51,7 +51,7 @@ class Module extends CatchController
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\db\exception\DataNotFoundException
*/
public function disOrEnable(string $module)
public function disOrEnable(string $module): Json
{
$moduleInfo = CatchAdmin::getModuleInfo(CatchAdmin::directory() . $module);
@@ -71,7 +71,7 @@ class Module extends CatchController
* @time 2020年09月21日
* @return Json
*/
public function cache()
public function cache(): Json
{
return CatchResponse::success(CatchAdmin::cacheServices());
}
@@ -82,7 +82,7 @@ class Module extends CatchController
* @time 2020年09月21日
* @return Json
*/
public function clear()
public function clear(): Json
{
return !file_exists(CatchAdmin::getCacheServicesFile()) ?
CatchResponse::fail('模块没有缓存') :