增加 uris 操作,需要更新 Library

This commit is contained in:
Anyon 2022-04-21 15:35:39 +08:00
parent 6fec22723b
commit ddd01c6f46
2 changed files with 6 additions and 7 deletions

View File

@ -43,7 +43,6 @@ class Login extends Controller
if (AdminService::instance()->isLogin()) { if (AdminService::instance()->isLogin()) {
$this->redirect(sysuri('admin/index/index')); $this->redirect(sysuri('admin/index/index'));
} else { } else {
// 登录验证码 // 登录验证码
$this->captchaType = 'LoginCaptcha'; $this->captchaType = 'LoginCaptcha';
$this->captchaToken = CodeExtend::uniqidDate(18); $this->captchaToken = CodeExtend::uniqidDate(18);
@ -52,18 +51,18 @@ class Login extends Controller
$this->developMode = $system->checkRunMode(); $this->developMode = $system->checkRunMode();
// 后台背景处理 // 后台背景处理
$images = str2arr(sysconf('login_image') ?: '', '|') ?: [ $images = str2arr(sysconf('login_image') ?: '', '|') ?: [
$system->paths('/static/theme/img/login/bg1.jpg')['__ROOT__'], $system->uri('/static/theme/img/login/bg1.jpg'),
$system->paths('/static/theme/img/login/bg2.jpg')['__ROOT__'], $system->uri('/static/theme/img/login/bg2.jpg'),
]; ];
$this->loginStyle = sprintf('style="background-image:url(%s)" data-bg-transition="%s"', $images[0], join(',', $images)); $this->loginStyle = sprintf('style="background-image:url(%s)" data-bg-transition="%s"', $images[0], join(',', $images));
// 记录后台域名 // 更新后台域名
$host = "{$this->request->scheme()}://{$this->request->host()}"; $host = "{$this->request->scheme()}://{$this->request->host()}";
if ($host !== sysconf('base.site_host')) sysconf('base.site_host', $host); if ($host !== sysconf('base.site_host')) sysconf('base.site_host', $host);
// 标记登录验证令牌 // 标记验证令牌
if (!$this->app->session->get('LoginInputSessionError')) { if (!$this->app->session->get('LoginInputSessionError')) {
$this->app->session->set($this->captchaType, $this->captchaToken); $this->app->session->set($this->captchaType, $this->captchaToken);
} }
// 加载显示登录模板 // 加载登录模板
$this->title = '系统登录'; $this->title = '系统登录';
$this->fetch(); $this->fetch();
} }

View File

@ -42,5 +42,5 @@ return [
// 标签默认过滤输出方法 // 标签默认过滤输出方法
'default_filter' => 'htmlentities=###,ENT_QUOTES', 'default_filter' => 'htmlentities=###,ENT_QUOTES',
// 定义模板替换字符串 // 定义模板替换字符串
'tpl_replace_string' => SystemService::instance()->paths(), 'tpl_replace_string' => SystemService::instance()->uris(),
]; ];