Переглянути джерело

修复 api接口缺少的isPrompt属性

萤火科技 1 рік тому
батько
коміт
1d91ba633b
1 змінених файлів з 2 додано та 1 видалено
  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'));
 }
 
 /**