作者 邓超

1

@@ -34,7 +34,7 @@ class Folder extends Base { @@ -34,7 +34,7 @@ class Folder extends Base {
34 // 转tree 34 // 转tree
35 $folders = list_to_tree($folders); 35 $folders = list_to_tree($folders);
36 36
37 - app()->_json($folders); 37 + return $folders;
38 } 38 }
39 39
40 40
@@ -6,7 +6,7 @@ use Lib\Mail\MailFun; @@ -6,7 +6,7 @@ use Lib\Mail\MailFun;
6 use Lib\Verify; 6 use Lib\Verify;
7 use Model\emailSql; 7 use Model\emailSql;
8 use Model\listsSql; 8 use Model\listsSql;
9 -use function Swoole\Coroutine\Http\request; 9 +
10 10
11 /** 11 /**
12 * @author:dc 12 * @author:dc
@@ -130,7 +130,17 @@ class App { @@ -130,7 +130,17 @@ class App {
130 130
131 }catch (\Throwable $exception){ 131 }catch (\Throwable $exception){
132 132
133 - if(!($exception instanceof Err)){ 133 + if($exception instanceof Err){
  134 +
  135 + if ($exception->getCode() !== 200){
  136 + $app->data = [
  137 + 'error_message' => $exception->getMessage(),
  138 + 'status' => $exception->getCode() ? $exception->getCode() : 500,
  139 + ];
  140 + }
  141 +
  142 + }else{
  143 +
134 $app->error = [ 144 $app->error = [
135 'message' => $exception->getMessage(), 145 'message' => $exception->getMessage(),
136 'file' => $exception->getFile(), 146 'file' => $exception->getFile(),
@@ -143,11 +153,6 @@ class App { @@ -143,11 +153,6 @@ class App {
143 'error_message' => $app->debug ? $exception->getMessage().PHP_EOL.$exception->getTraceAsString() : __('server_error'), 153 'error_message' => $app->debug ? $exception->getMessage().PHP_EOL.$exception->getTraceAsString() : __('server_error'),
144 'status' => $exception->getCode() ? $exception->getCode() : 500, 154 'status' => $exception->getCode() ? $exception->getCode() : 500,
145 ]; 155 ];
146 - }else{  
147 - $app->data = [  
148 - 'error_message' => $exception->getMessage(),  
149 - 'status' => $exception->getCode() ? $exception->getCode() : 500,  
150 - ];  
151 } 156 }
152 157
153 } 158 }