Преглед на файлове

修复 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'));
 }
 
 /**