作者 李小龙

表单提交

... ... @@ -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);
}
}
... ...
... ... @@ -63,7 +63,7 @@ class InquiryController extends BaseController
}
//return $this->success();
//新增表单提,返回跳转链接
return $this->response($this->inquiryResult());
return $this->responseA($this->inquiryResult());
}
/**
... ...