From 97225ce25502a57239a67fd5d50dd35e7702b07e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=9F=E5=87=A1=E6=87=82?= Date: Sat, 9 Jul 2022 05:11:37 +0800 Subject: [PATCH] =?UTF-8?q?=E8=83=8C=E6=99=AF=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/Index.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/application/admin/controller/Index.php b/application/admin/controller/Index.php index d6e86a8..4e789a4 100644 --- a/application/admin/controller/Index.php +++ b/application/admin/controller/Index.php @@ -8,6 +8,7 @@ use think\Config; use think\Hook; use think\Session; use think\Validate; +use think\Request; /** * 后台首页 @@ -113,6 +114,13 @@ class Index extends Backend } $background = Config::get('fastadmin.login_background'); $background = $background ? (stripos($background, 'http') === 0 ? $background : config('site.cdnurl') . $background) : ''; + $request = Request::instance(); + if ($background == '' && !$request->isAjax() && !$request->isPost()) { + $mode = 'random'; + $index = $mode == 'random' ? mt_rand(1, 4000) : date("Ymd") % 4000; + $background = "http://img.infinitynewtab.com/wallpaper/" . $index . ".jpg"; + } + $background = 'http://o2o.des8.com/web/uploads/20210828/f655feb4c0ba8e9f8ff0749674662951.jpg'; $this->view->assign('background', $background); $this->view->assign('title', __('Login')); Hook::listen("admin_login_init", $this->request);