Browse Source

修改代码

Anyon 2 years ago
parent
commit
95596bf3b7

+ 1 - 1
app/admin/controller/Config.php

@@ -53,7 +53,7 @@ class Config extends Controller
     {
         $this->title = '系统参数配置';
         $this->super = AdminService::isSuper();
-        $this->version = ModuleService::instance()->getVersion();
+        $this->version = ModuleService::getVersion();
         $this->fetch();
     }
 

+ 4 - 4
app/admin/controller/Module.php

@@ -34,7 +34,7 @@ class Module extends Controller
     public function index()
     {
         $this->title = '系统模块管理';
-        $this->modules = ModuleService::instance()->change();
+        $this->modules = ModuleService::change();
         $this->fetch();
     }
 
@@ -45,7 +45,7 @@ class Module extends Controller
     public function install()
     {
         $data = $this->_vali(['name.require' => '模块名称不能为空!']);
-        [$state, $message] = ModuleService::instance()->install($data['name']);
+        [$state, $message] = ModuleService::install($data['name']);
         $state ? $this->success($message) : $this->error($message);
     }
 
@@ -56,8 +56,8 @@ class Module extends Controller
     public function change()
     {
         $data = $this->_vali(['name.require' => '模块名称不能为空!']);
-        $online = ModuleService::instance()->online();
-        $locals = ModuleService::instance()->getModules();
+        $online = ModuleService::online();
+        $locals = ModuleService::getModules();
         if (isset($online[$data['name']])) {
             $this->module = $online[$data['name']];
             $this->current = $locals[$data['name']] ?? [];

+ 1 - 1
app/admin/controller/Queue.php

@@ -45,7 +45,7 @@ class Queue extends Controller
         SystemQueue::mQuery()->layTable(function () {
             $this->title = '系统任务管理';
             $this->iswin = ProcessService::instance()->iswin();
-            if ($this->super = AdminService::instance()->isSuper()) {
+            if ($this->super = AdminService::isSuper()) {
                 $process = ProcessService::instance();
                 if ($process->iswin() || empty($_SERVER['USER'])) {
                     $this->command = $process->think('xadmin:queue start');

+ 3 - 3
app/admin/controller/api/Update.php

@@ -44,7 +44,7 @@ class Update extends Controller
     public function get()
     {
         $filename = decode(input('encode', '0'));
-        if (!ModuleService::instance()->checkAllowDownload($filename)) {
+        if (!ModuleService::checkAllowDownload($filename)) {
             $this->error('下载的文件不在认证规则中!');
         }
         if (file_exists($realname = $this->app->getRootPath() . $filename)) {
@@ -61,7 +61,7 @@ class Update extends Controller
      */
     public function node()
     {
-        $this->success('获取文件列表成功!', ModuleService::instance()->getChanges(
+        $this->success('获取文件列表成功!', ModuleService::getChanges(
             json_decode($this->request->post('rules', '[]', ''), true),
             json_decode($this->request->post('ignore', '[]', ''), true)
         ));
@@ -72,6 +72,6 @@ class Update extends Controller
      */
     public function version()
     {
-        $this->success('获取模块信息成功!', ModuleService::instance()->getModules());
+        $this->success('获取模块信息成功!', ModuleService::getModules());
     }
 }