diff --git a/application/third_party/pagespeed/controllers/index.php b/application/third_party/pagespeed/controllers/index.php index 24b9b48f..c3ffcc6c 100644 --- a/application/third_party/pagespeed/controllers/index.php +++ b/application/third_party/pagespeed/controllers/index.php @@ -28,6 +28,19 @@ class Index extends CI_Controller { } } + public function show_score() { + $psd_URL = $this->input->get_post('psd_URL'); + $psd_SiteCode = $this->input->get_post('psd_SiteCode'); + if (empty($psd_URL) || empty($psd_SiteCode)) { + echo json_encode(array('result' => 'error', 'data' => 'url或站点为空')); + return false; + } + $pagespeed_data = $this->PageSpeedData_model->detail($psd_URL, $psd_SiteCode); + if (!empty($pagespeed_data)) { + echo json_encode(array('result' => 'ok', 'data' => 'M:' . $pagespeed_data->psd_MobileScore . ',D:' . $pagespeed_data->psd_DesktopScore)); + } + } + public function run($psd_URL = false, $psd_SiteCode = false) { if (empty($psd_URL) || empty($psd_SiteCode)) { $psd_URL = $this->input->get_post('psd_URL'); @@ -89,7 +102,7 @@ class Index extends CI_Controller { $where = array('psd_id' => $pagespeed_data->psd_id); $this->PageSpeedData_model->update('PageSpeedData', $PageSpeedData, $where); } - echo json_encode(array('result' => 'ok', 'data' => 'M:'.$PageSpeedData->psd_MobileScore.',D:'.$PageSpeedData->psd_DesktopScore)); + echo json_encode(array('result' => 'ok', 'data' => 'M:' . $PageSpeedData->psd_MobileScore . ',D:' . $PageSpeedData->psd_DesktopScore)); } } diff --git a/application/views/bootstrap3/information_edit.php b/application/views/bootstrap3/information_edit.php index e6283001..7bd648aa 100644 --- a/application/views/bootstrap3/information_edit.php +++ b/application/views/bootstrap3/information_edit.php @@ -1182,9 +1182,9 @@
+ mobile_friendly(true);">网页性能检测: - HTML规范验证 +