|
|
@ -20,6 +20,7 @@ class Index extends CI_Controller
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$htmlsource = $this->input->post('htmlsource');
|
|
|
|
$htmlsource = $this->input->post('htmlsource');
|
|
|
|
$websitehost = $this->input->post('websitehost');
|
|
|
|
$websitehost = $this->input->post('websitehost');
|
|
|
|
|
|
|
|
$template_name = $this->input->post('template_name');
|
|
|
|
$create_amp = $this->input->post('create_amp');
|
|
|
|
$create_amp = $this->input->post('create_amp');
|
|
|
|
if (empty($htmlsource) || empty($websitehost)) {
|
|
|
|
if (empty($htmlsource) || empty($websitehost)) {
|
|
|
|
$this->output->set_status_header(500);
|
|
|
|
$this->output->set_status_header(500);
|
|
|
@ -138,7 +139,7 @@ class Index extends CI_Controller
|
|
|
|
|
|
|
|
|
|
|
|
//只返回AMP代码
|
|
|
|
//只返回AMP代码
|
|
|
|
if (!empty($create_amp)) {
|
|
|
|
if (!empty($create_amp)) {
|
|
|
|
$amp = $this->create_amp($html_object, 'ah', $websitehost);
|
|
|
|
$amp = $this->create_amp($html_object, $template_name, $websitehost);
|
|
|
|
echo json_encode(array('result' => 'ok', 'data' => array('amp' => $amp)));
|
|
|
|
echo json_encode(array('result' => 'ok', 'data' => array('amp' => $amp)));
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|