rabin 20 hours ago
parent
commit
cfa9e294e8
3 changed files with 17 additions and 9 deletions
  1. 10 2
      src/Dever/App.php
  2. 2 2
      src/Dever/Helper/Curl.php
  3. 5 5
      src/Dever/Project.php

+ 10 - 2
src/Dever/App.php

@@ -9,10 +9,18 @@ class App
     {
         if ($class && empty($this->class)) {
             if (strpos($class, '/')) {
-                [$this->app, $this->name] = explode('/', $class, 2);
+                $temp = explode('/', $class, 2);
+                if (empty($temp[1])) {
+                    Dever::error($class . ' error');
+                }
+                [$this->app, $this->name] = $temp;
                 $class = strtr($class, '/', '\\');
             } else {
-                [$this->app, $this->name] = explode('\\', $class, 2);
+                $temp = explode('\\', $class, 2);
+                if (empty($temp[1])) {
+                    Dever::error($class . ' error');
+                }
+                [$this->app, $this->name] = $temp;
                 $this->name = strtr($this->name, '\\', '/');
             }
             $project = Dever::project($this->app);

+ 2 - 2
src/Dever/Helper/Curl.php

@@ -130,10 +130,10 @@ class Curl
     public function setJson($param)
     {
         if (is_array($param)) {
-            if (isset($param['item_desc'])) {
+            if ($param) {
                 $param = Dever::json_encode($param);
             } else {
-                $param = Dever::json_encode($param);
+                $param = '{}';
             }
         }
         $header['Content-Type'] = 'application/json';

+ 5 - 5
src/Dever/Project.php

@@ -34,13 +34,13 @@ class Project
             if (empty($this->content[DEVER_APP_NAME]['path'])) {
                 $this->content[DEVER_APP_NAME]['path'] = DEVER_APP_PATH;
             }
-            if (isset($this->content['manage'])) {
-                $manage = $this->content['manage'];
-                unset($this->content['manage']);
-                $this->content = array_merge(['manage' => $manage], $this->content);
+            if (isset($this->content['Manage'])) {
+                $manage = $this->content['Manage'];
+                unset($this->content['Manage']);
+                $this->content = array_merge(['Manage' => $manage], $this->content);
             }
             $this->content($file);
-            if (isset($this->content['manage'])) {
+            if (isset($this->content['Manage'])) {
                 Dever::load(\Manage\Lib\Menu::class)->init();
             }
         }