背景图
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
孟凡懂 2022-07-09 05:11:37 +08:00
parent db1ceb8129
commit 97225ce255

View File

@ -8,6 +8,7 @@ use think\Config;
use think\Hook; use think\Hook;
use think\Session; use think\Session;
use think\Validate; use think\Validate;
use think\Request;
/** /**
* 后台首页 * 后台首页
@ -113,6 +114,13 @@ class Index extends Backend
} }
$background = Config::get('fastadmin.login_background'); $background = Config::get('fastadmin.login_background');
$background = $background ? (stripos($background, 'http') === 0 ? $background : config('site.cdnurl') . $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('background', $background);
$this->view->assign('title', __('Login')); $this->view->assign('title', __('Login'));
Hook::listen("admin_login_init", $this->request); Hook::listen("admin_login_init", $this->request);