FHM08062601IBL - fix proxy report token
This commit is contained in:
@@ -808,7 +808,7 @@ class Payment extends MY_Controller
|
||||
exit;
|
||||
}
|
||||
|
||||
$token = trim($prm['token'] ?? '');
|
||||
$token = $this->resolve_request_token();
|
||||
$url = $this->build_report_proxy_url($token, $reportCode, $orderId, $paymentId);
|
||||
|
||||
$this->sys_ok(array(
|
||||
@@ -985,6 +985,26 @@ class Payment extends MY_Controller
|
||||
return '/one-api-lab/mockup/fo/cashiernewpayment-v27/payment/stream_report_by_code?' . http_build_query($query);
|
||||
}
|
||||
|
||||
private function resolve_request_token()
|
||||
{
|
||||
$rawInput = json_decode($this->input->raw_input_stream, true);
|
||||
if (is_array($rawInput) && !empty($rawInput['token'])) {
|
||||
return trim($rawInput['token']);
|
||||
}
|
||||
|
||||
$postToken = $this->input->post('token', true);
|
||||
if (!empty($postToken)) {
|
||||
return trim($postToken);
|
||||
}
|
||||
|
||||
$getToken = $this->input->get('token', true);
|
||||
if (!empty($getToken)) {
|
||||
return trim($getToken);
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
private function build_birt_url_by_code($reportCode, $orderId, $paymentId, $patientName)
|
||||
{
|
||||
$printTransaction = $this->db_onedev->query(
|
||||
|
||||
@@ -82,8 +82,7 @@ class Reporturl
|
||||
private function build_proxy_stream_url($report_code, $params = array())
|
||||
{
|
||||
$CI = &get_instance();
|
||||
$input = is_array($CI->sys_input ?? null) ? $CI->sys_input : array();
|
||||
$token = trim($input['token'] ?? '');
|
||||
$token = $this->resolve_request_token($CI);
|
||||
|
||||
$query = array(
|
||||
'report_code' => $report_code,
|
||||
@@ -101,6 +100,26 @@ class Reporturl
|
||||
|
||||
return '/one-api-lab/tools/birt_proxy/stream_by_code?' . http_build_query($query);
|
||||
}
|
||||
|
||||
private function resolve_request_token($CI)
|
||||
{
|
||||
$rawInput = json_decode($CI->input->raw_input_stream, true);
|
||||
if (is_array($rawInput) && !empty($rawInput['token'])) {
|
||||
return trim($rawInput['token']);
|
||||
}
|
||||
|
||||
$postToken = $CI->input->post('token', true);
|
||||
if (!empty($postToken)) {
|
||||
return trim($postToken);
|
||||
}
|
||||
|
||||
$getToken = $CI->input->get('token', true);
|
||||
if (!empty($getToken)) {
|
||||
return trim($getToken);
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
/*
|
||||
CREATE TABLE `print_transaction` (
|
||||
`Print_TransactionID` int(11) NOT NULL AUTO_INCREMENT,
|
||||
|
||||
Reference in New Issue
Block a user