|
...
|
...
|
@@ -141,5 +141,22 @@ class BaseController extends Controller |
|
|
|
throw new HttpResponseException($response);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 表单单独响应数据格式
|
|
|
|
*/
|
|
|
|
public function responseA($data = [], $code = 200, $msg = 'success', $result_code = 200, $type = 'application/json')
|
|
|
|
{
|
|
|
|
$result = [
|
|
|
|
'msg' => $msg,
|
|
|
|
'code' => $code,
|
|
|
|
'data' => $data,
|
|
|
|
];
|
|
|
|
$header = [
|
|
|
|
'Content-Type' => $type,
|
|
|
|
];
|
|
|
|
$response = response($result, $result_code, $header);
|
|
|
|
throw new HttpResponseException($response);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
} |
...
|
...
|
|