|
@@ -141,5 +141,22 @@ class BaseController extends Controller |
|
@@ -141,5 +141,22 @@ class BaseController extends Controller |
|
141
|
throw new HttpResponseException($response);
|
141
|
throw new HttpResponseException($response);
|
|
142
|
}
|
142
|
}
|
|
143
|
|
143
|
|
|
|
|
144
|
+ /**
|
|
|
|
145
|
+ * 表单单独响应数据格式
|
|
|
|
146
|
+ */
|
|
|
|
147
|
+ public function responseA($data = [], $code = 200, $msg = 'success', $result_code = 200, $type = 'application/json')
|
|
|
|
148
|
+ {
|
|
|
|
149
|
+ $result = [
|
|
|
|
150
|
+ 'msg' => $msg,
|
|
|
|
151
|
+ 'code' => $code,
|
|
|
|
152
|
+ 'data' => $data,
|
|
|
|
153
|
+ ];
|
|
|
|
154
|
+ $header = [
|
|
|
|
155
|
+ 'Content-Type' => $type,
|
|
|
|
156
|
+ ];
|
|
|
|
157
|
+ $response = response($result, $result_code, $header);
|
|
|
|
158
|
+ throw new HttpResponseException($response);
|
|
|
|
159
|
+ }
|
|
|
|
160
|
+
|
|
144
|
|
161
|
|
|
145
|
} |
162
|
} |