diff --git a/application/config/config.php b/application/config/config.php index f452e73d..d2ccda34 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -415,7 +415,6 @@ $config['site'] = array( ); //静态文件生成路径 - $config['cache']['jp']['cache_path'] = 'C:\VHD\Dropbox\wwwcache\arachina.com'; $config['cache']['gm']['cache_path'] = 'C:\VHD\Dropbox\wwwcache\chinarundreisen.com'; $config['cache']['vc']['cache_path'] = 'C:\VHD\Dropbox\wwwcache\voyageschine.com'; @@ -423,6 +422,14 @@ $config['cache']['vac']['cache_path'] = 'C:\VHD\Dropbox\wwwcache\viaje-a-china.c $config['cache']['ru']['cache_path'] = 'C:\VHD\Dropbox\wwwcache\chinahighlights.ru'; $config['cache']['it']['cache_path'] = 'C:\VHD\Dropbox\wwwcache\viaggio-in-cina.it'; +//静态文件站点域名 +$config['cache']['jp']['site_url'] = 'https://www.arachina.com'; +$config['cache']['gm']['site_url'] = 'https://www.chinarundreisen.com'; +$config['cache']['vc']['site_url'] = 'https://www.voyageschine.com'; +$config['cache']['vac']['site_url'] = 'https://www.viaje-a-china.com'; +$config['cache']['ru']['site_url'] = 'https://www.chinahighlights.ru'; +$config['cache']['it']['site_url'] = 'https://www.viaggio-in-cina.it'; + //静态文件更新接口 $config['cache']['jp']['cache_api'] = '/info.php/information/update_cache/'; $config['cache']['gm']['cache_api'] = '/info.php/information/update_cache/'; diff --git a/application/controllers/cache.php b/application/controllers/cache.php index 0705a6b2..0f81dbae 100644 --- a/application/controllers/cache.php +++ b/application/controllers/cache.php @@ -26,7 +26,7 @@ class Cache extends CI_Controller $this->load->model('Area_model'); $this->load->model('InfoStructures_model'); $this->load->model('Information_model'); - $this->site_code = $this->config->item('site_code'); + $this->site_code = $this->input->get('site_code') || $this->config->item('site_code'); } /** @@ -39,13 +39,14 @@ class Cache extends CI_Controller */ public function update() { + $returnType = $this->input->get('type'); //设置缓存文件文件夹 $cache_config = $this->config->item('cache'); $current_cache_config = $cache_config[$this->site_code]; $this->dir = $current_cache_config['cache_path']; //设置当前站点 - $this->current_domain = $this->config->item('site_url'); + $this->current_domain = $current_cache_config['site_url']; //$this->config->item('site_url'); //echo $this->config->item('site_url'); //设置缓存更新接口及POST参数 $this->cache_api = $current_cache_config['cache_api']; @@ -66,8 +67,12 @@ class Cache extends CI_Controller $data['cache_api'] = $this->cache_api; $data['post_para'] = $this->post_para; - //视图 - $this->load->view('cache/update', $data); + if ($returnType === 'json') { + echo (json_encode($this->file)); + } else { + //视图 + $this->load->view('cache/update', $data); + } } /**