From df3b317e44bb2b76845c5ed9587b726fc48e78eb Mon Sep 17 00:00:00 2001 From: winzer Date: Thu, 14 Jan 2021 19:10:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E6=8E=A5=E5=85=A5=E4=BA=A7?= =?UTF-8?q?=E5=93=81=E5=8A=A8=E6=80=81=EF=BC=8C=E7=9B=B8=E5=85=B3=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=E6=8C=87=E5=90=91=E5=AE=98=E7=BD=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Admin/Controllers/IndexController.php | 2 ++ app/Http/Admin/Services/Index.php | 14 ++++++++++++++ app/Http/Admin/Views/index/index.volt | 2 +- app/Http/Admin/Views/index/main_app_info.volt | 2 +- app/Http/Admin/Views/index/main_app_trend.volt | 15 ++++++++++++++- app/Http/Admin/Views/index/main_team_info.volt | 2 +- app/Http/Home/Views/partials/footer.volt | 6 +++--- app/Library/AppInfo.php | 2 +- 8 files changed, 37 insertions(+), 8 deletions(-) diff --git a/app/Http/Admin/Controllers/IndexController.php b/app/Http/Admin/Controllers/IndexController.php index 4684800a..7b7b9da2 100644 --- a/app/Http/Admin/Controllers/IndexController.php +++ b/app/Http/Admin/Controllers/IndexController.php @@ -39,11 +39,13 @@ class IndexController extends Controller $todayStat = $indexService->getTodayStat(); $appInfo = $indexService->getAppInfo(); $serverInfo = $indexService->getServerInfo(); + $releases = $indexService->getReleases(); $this->view->setVar('global_stat', $globalStat); $this->view->setVar('today_stat', $todayStat); $this->view->setVar('app_info', $appInfo); $this->view->setVar('server_info', $serverInfo); + $this->view->setVar('releases', $releases); } /** diff --git a/app/Http/Admin/Services/Index.php b/app/Http/Admin/Services/Index.php index cf89b904..9febad0f 100644 --- a/app/Http/Admin/Services/Index.php +++ b/app/Http/Admin/Services/Index.php @@ -6,6 +6,7 @@ use App\Caches\SiteGlobalStat; use App\Caches\SiteTodayStat; use App\Library\AppInfo; use App\Library\Utils\ServerInfo; +use GuzzleHttp\Client; class Index extends Service { @@ -52,4 +53,17 @@ class Index extends Service return $cache->get(); } + public function getReleases() + { + $url = 'https://koogua.com/api-releases.json'; + + $client = new Client(); + + $response = $client->get($url, ['timeout' => 3]); + + $content = json_decode($response->getBody(), true); + + return $content['releases'] ?? []; + } + } diff --git a/app/Http/Admin/Views/index/index.volt b/app/Http/Admin/Views/index/index.volt index a676fc79..fd48a48a 100644 --- a/app/Http/Admin/Views/index/index.volt +++ b/app/Http/Admin/Views/index/index.volt @@ -63,7 +63,7 @@ diff --git a/app/Http/Admin/Views/index/main_app_info.volt b/app/Http/Admin/Views/index/main_app_info.volt index e5199d2e..4dbf67a5 100644 --- a/app/Http/Admin/Views/index/main_app_info.volt +++ b/app/Http/Admin/Views/index/main_app_info.volt @@ -13,7 +13,7 @@ 系统框架 - Phalcon 3.4.5 + Phalcon 3.4.5 获取渠道 diff --git a/app/Http/Admin/Views/index/main_app_trend.volt b/app/Http/Admin/Views/index/main_app_trend.volt index 44cef704..fd4d4684 100644 --- a/app/Http/Admin/Views/index/main_app_trend.volt +++ b/app/Http/Admin/Views/index/main_app_trend.volt @@ -1,6 +1,19 @@
产品动态
- + + + + + + + {% for release in releases %} + + + + + {% endfor %} + +
{{ release.title }}{{ release.date }}
\ No newline at end of file diff --git a/app/Http/Admin/Views/index/main_team_info.volt b/app/Http/Admin/Views/index/main_team_info.volt index c09a7637..85c36e01 100644 --- a/app/Http/Admin/Views/index/main_team_info.volt +++ b/app/Http/Admin/Views/index/main_team_info.volt @@ -9,7 +9,7 @@ 版权所有 - 深圳市酷瓜软件有限公司 + 深圳市酷瓜软件有限公司 产品经理 diff --git a/app/Http/Home/Views/partials/footer.volt b/app/Http/Home/Views/partials/footer.volt index 745f6e85..9ac1d4a5 100644 --- a/app/Http/Home/Views/partials/footer.volt +++ b/app/Http/Home/Views/partials/footer.volt @@ -9,12 +9,12 @@ {% if site_info.copyright %} © {{ site_info.copyright }} {% endif %} - Powered by {{ app_info.alias }} {{ app_info.version }} + Powered by {{ app_info.alias }} {{ app_info.version }} {% if site_info.icp_sn %} - {{ site_info.icp_sn }} + {{ site_info.icp_sn }} {% endif %} {% if site_info.police_sn %} - {{ site_info.police_sn }} + {{ site_info.police_sn }} {% endif %} diff --git a/app/Library/AppInfo.php b/app/Library/AppInfo.php index f130a713..945913fc 100644 --- a/app/Library/AppInfo.php +++ b/app/Library/AppInfo.php @@ -9,7 +9,7 @@ class AppInfo protected $alias = 'CTC'; - protected $link = 'https://gitee.com/koogua'; + protected $link = 'https://koogua.com'; protected $version = '1.2.4';