From 42b43d1eddc4251ceb0bf57524ae99797808173b Mon Sep 17 00:00:00 2001 From: LMR <59361885@qq.com> Date: Thu, 15 Aug 2024 13:36:08 +0800 Subject: [PATCH 1/5] s --- application/controllers/infofix.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/application/controllers/infofix.php b/application/controllers/infofix.php index adbe94b4..c6963341 100644 --- a/application/controllers/infofix.php +++ b/application/controllers/infofix.php @@ -195,11 +195,13 @@ class infofix extends CI_Controller { $ic = $this->infoContents_model->get_ic_contents2($ic_id); $json = $this->infoMetas_model->get($ic_id, 'AMP_JSON'); + $use = $this->infoMetas_model->get($ic_id, 'AMP_BODY_PC_STATUS'); if ($ic) { echo json_encode( array( 'state' => 0, 'ic_content' => $ic->ic_content, + 'pc_use' => $use, 'json' => $json ) ); From 8674ef54f71ed4bcc52b6d93ebe5cf0dbe8cf7aa Mon Sep 17 00:00:00 2001 From: LMR <59361885@qq.com> Date: Thu, 15 Aug 2024 13:59:39 +0800 Subject: [PATCH 2/5] fix --- application/controllers/infofix.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/application/controllers/infofix.php b/application/controllers/infofix.php index c6963341..598dd911 100644 --- a/application/controllers/infofix.php +++ b/application/controllers/infofix.php @@ -193,6 +193,7 @@ class infofix extends CI_Controller */ function get_by_icid($ic_id) { + header('Access-Control-Allow-Origin: *'); $ic = $this->infoContents_model->get_ic_contents2($ic_id); $json = $this->infoMetas_model->get($ic_id, 'AMP_JSON'); $use = $this->infoMetas_model->get($ic_id, 'AMP_BODY_PC_STATUS'); @@ -217,6 +218,7 @@ class infofix extends CI_Controller function update_by_icid() { + header('Access-Control-Allow-Origin: *'); $ic_id = $this->input->get_post('ic_id'); $ic_content = $this->input->get_post('ic_content'); $this->infoContents_model->force_update($ic_id, $ic_content); From 2d42fab88c10386b7d2e84ea4377c736ae2e6877 Mon Sep 17 00:00:00 2001 From: LMR <59361885@qq.com> Date: Thu, 15 Aug 2024 14:00:08 +0800 Subject: [PATCH 3/5] fix --- application/controllers/infofix.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/application/controllers/infofix.php b/application/controllers/infofix.php index 598dd911..f55f365a 100644 --- a/application/controllers/infofix.php +++ b/application/controllers/infofix.php @@ -13,11 +13,11 @@ class infofix extends CI_Controller $this->load->model('infoContents_model'); $this->load->model('infoMetas_model'); $this->site_code = $this->input->get('site_code') ? $this->input->get('site_code') : $this->config->item('site_code'); + header('Access-Control-Allow-Origin: *'); } function list_info_by_keys() { - header('Access-Control-Allow-Origin: *'); // 防止超时 set_time_limit(0); @@ -116,7 +116,6 @@ class infofix extends CI_Controller function update_info_by_keys() { - header('Access-Control-Allow-Origin: *'); // json参数 $site = $this->input->get_post('site'); $keys = $this->input->get_post('keys'); @@ -193,7 +192,6 @@ class infofix extends CI_Controller */ function get_by_icid($ic_id) { - header('Access-Control-Allow-Origin: *'); $ic = $this->infoContents_model->get_ic_contents2($ic_id); $json = $this->infoMetas_model->get($ic_id, 'AMP_JSON'); $use = $this->infoMetas_model->get($ic_id, 'AMP_BODY_PC_STATUS'); @@ -218,7 +216,6 @@ class infofix extends CI_Controller function update_by_icid() { - header('Access-Control-Allow-Origin: *'); $ic_id = $this->input->get_post('ic_id'); $ic_content = $this->input->get_post('ic_content'); $this->infoContents_model->force_update($ic_id, $ic_content); From 4c7411cd5d21612ef8e4a0693a097b089fb51d1b Mon Sep 17 00:00:00 2001 From: LMR <59361885@qq.com> Date: Fri, 16 Aug 2024 15:21:13 +0800 Subject: [PATCH 4/5] fix json --- application/controllers/infofix.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/controllers/infofix.php b/application/controllers/infofix.php index f55f365a..2556e414 100644 --- a/application/controllers/infofix.php +++ b/application/controllers/infofix.php @@ -201,7 +201,7 @@ class infofix extends CI_Controller 'state' => 0, 'ic_content' => $ic->ic_content, 'pc_use' => $use, - 'json' => $json + 'json' => json_encode($json) ) ); } else { From 5a1f579d0b5f29a553778fac46ea4773cb966d9f Mon Sep 17 00:00:00 2001 From: LMR <59361885@qq.com> Date: Fri, 16 Aug 2024 15:24:58 +0800 Subject: [PATCH 5/5] infofix fix --- application/controllers/infofix.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/controllers/infofix.php b/application/controllers/infofix.php index 2556e414..a8a3ed2e 100644 --- a/application/controllers/infofix.php +++ b/application/controllers/infofix.php @@ -193,7 +193,7 @@ class infofix extends CI_Controller function get_by_icid($ic_id) { $ic = $this->infoContents_model->get_ic_contents2($ic_id); - $json = $this->infoMetas_model->get($ic_id, 'AMP_JSON'); + $json = json_decode($this->infoMetas_model->get($ic_id, 'AMP_JSON')); $use = $this->infoMetas_model->get($ic_id, 'AMP_BODY_PC_STATUS'); if ($ic) { echo json_encode( @@ -201,7 +201,7 @@ class infofix extends CI_Controller 'state' => 0, 'ic_content' => $ic->ic_content, 'pc_use' => $use, - 'json' => json_encode($json) + 'json' => $json ) ); } else {