From e5ec2421ecc53df850fbe3ad0a2f54bb120cd5b9 Mon Sep 17 00:00:00 2001 From: LMR <59361885@qq.com> Date: Thu, 10 Oct 2019 14:34:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=AA=E6=9C=89add=E5=92=8Cedit=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0cors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/third_party/advertise/controllers/index.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/third_party/advertise/controllers/index.php b/application/third_party/advertise/controllers/index.php index 494b5479..25e59be9 100644 --- a/application/third_party/advertise/controllers/index.php +++ b/application/third_party/advertise/controllers/index.php @@ -12,7 +12,6 @@ class Index extends CI_Controller $this->permission->is_admin(); $this->load->model('InfoStructures_model'); $this->load->model('advertise_model'); - header('Access-Control-Allow-Origin: *'); } //广告列表 @@ -65,6 +64,7 @@ class Index extends CI_Controller public function ad_edit() { + header('Access-Control-Allow-Origin: *'); $ad_title = $this->input->post('ad_title'); $ad_content = $this->input->post('ad_content'); $ad_type = ''; @@ -111,6 +111,7 @@ class Index extends CI_Controller //添加新广告节点 public function add($is_parent_id, $is_ajax = true) { + header('Access-Control-Allow-Origin: *'); $insert_id = $this->InfoStructures_model->Add($is_parent_id); if ($insert_id && $ad_id = $this->advertise_model->add_advertise($insert_id, 'New tree', $this->config->item('site_code'), time())) { $data[] = array('name' => 'ok', 'value' => $insert_id);