Ver Fonte

修复 api接口缺少的isPrompt属性

萤火科技 há 1 ano atrás
pai
commit
1d91ba633b
1 ficheiros alterados com 2 adições e 1 exclusões
  1. 2 1
      app/common.php

+ 2 - 1
app/common.php

@@ -71,7 +71,8 @@ function tre($content)
 function throwError(string $message, ?int $status = null, array $data = [])
 {
     is_null($status) && $status = config('status.error');
-    throw new BaseException(['status' => $status, 'message' => $message, 'data' => $data]);
+    $data = \array_merge(['isPrompt' => true], $data);
+    throw new BaseException(compact('status', 'message', 'data'));
 }
 
 /**