fastadmin修改后台登录背景

背景

fastadmin 用习惯了,但是登录界面真的不好看,今天就修改一下。先看界面:

解决方案

1.安装插件:后台登录背景。

2.上传固定图片修改登录页面为如下:

html 复制代码
<!DOCTYPE html>
<html>
<head>
    {include file="common/meta" /}

    <style type="text/css">
        body {
            color: #999;
            background-color: #f1f4fd;
            background-size: cover;
        }

        a {
            color: #444;
        }


        .login-screen {
            max-width: 430px;
            padding: 0;
            margin: 250px auto 0 auto;

        }

        .login-screen .well {
            border-radius: 7px;
            -webkit-box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
            box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
            background: rgba(255, 255, 255, 1);
            border: none;
            /*overflow: hidden;*/
            padding: 0;
        }

        @media (max-width: 767px) {
            .login-screen {
                padding: 0 20px;
            }
        }

        .profile-img-card {
            width: 50px;
            height: 50px;
            display: block;
            -moz-border-radius: 50%;
            -webkit-border-radius: 50%;
            border-radius: 50%;
            margin: 0px auto 20px;
            border: 5px solid #fff;
        }

        .profile-name-card {
            margin: 10px auto 20px;
            text-align: left;
            font-size: 20px;
            font-weight: bold;
            color:#0d0d0d;
        }

        .login-head {
            background: #899fe1;
            border-radius: 7px 7px 0 0;
        }

        .login-form {
            padding: 40px 30px;
            position: relative;
            z-index: 99;
        }

        #login-form {
            margin-top: 20px;
        }

        #login-form .input-group {
            margin-bottom: 15px;
        }

        #login-form .form-control {
            font-size: 13px;
        }

    </style>
    <!--@formatter:off-->
    {if $background}
    <style type="text/css">
        body{
            background-image: url('{$background}');
        }
    </style>
    {/if}
    <!--@formatter:on-->
</head>
<body>
<div class="container">
    <div class="login-wrapper">
        <div class="col-xs-12 col-sm-8">

        </div>
        <div class="login-screen col-xs-12 col-sm-4">

            <div class="well">
                <!--
                <div class="login-head">
                    <img src="__CDN__/assets/img/login-head.png" style="width:100%;"/>
                </div>
                -->
                <div class="login-form">
                    <div class="col-xs-12 col-sm-12" style="padding-left: 0px;margin-bottom: 20px;">
                        <div class="col-xs-12 col-sm-3" style="padding-left: 0px">
                            <img id="profile-img" class="profile-img-card" src="__CDN__/assets/img/avatar.png"/>
                        </div>
                        <div class="col-xs-12 col-sm-9 pl-0" >
                            <p id="profile-name" class="profile-name-card">{:$Think.config.site.name}</p>
                        </div>
                    </div>



                    <form action="" method="post" id="login-form">
                        <!--@AdminLoginFormBegin-->
                        <div id="errtips" class="hide"></div>
                        {:token()}
                        <div class="input-group">
                            <div class="input-group-addon"><span class="glyphicon glyphicon-user" aria-hidden="true"></span></div>
                            <input type="text" class="form-control" id="pd-form-username" placeholder="{:__('Username')}" name="username" autocomplete="off" value="" data-rule="{:__('Username')}:required;username"/>
                        </div>

                        <div class="input-group">
                            <div class="input-group-addon"><span class="glyphicon glyphicon-lock" aria-hidden="true"></span></div>
                            <input type="password" class="form-control" id="pd-form-password" placeholder="{:__('Password')}" name="password" autocomplete="off" value="" data-rule="{:__('Password')}:required;password"/>
                        </div>
                        <!--@CaptchaBegin-->
                        {if $Think.config.fastadmin.login_captcha}
                        <div class="input-group">
                            <div class="input-group-addon"><span class="glyphicon glyphicon-option-horizontal" aria-hidden="true"></span></div>
                            <input type="text" name="captcha" class="form-control" placeholder="{:__('Captcha')}" data-rule="{:__('Captcha')}:required;length({$Think.config.captcha.length})" autocomplete="off"/>
                            <span class="input-group-addon" style="padding:0;border:none;cursor:pointer;">
                                    <img src="{:rtrim('__PUBLIC__', '/')}/index.php?s=/captcha" width="100" height="30" onclick="this.src = '{:rtrim('__PUBLIC__', '/')}/index.php?s=/captcha&r=' + Math.random();"/>
                            </span>
                        </div>
                        {/if}
                        <!--@CaptchaEnd-->
                        {if $keeyloginhours>0}
                        <div class="form-group checkbox">
                            <label class="inline" for="keeplogin" data-toggle="tooltip" title="{:__('The duration of the session is %s hours', $keeyloginhours)}">
                                <input type="checkbox" name="keeplogin" id="keeplogin" value="1"/>
                                {:__('Keep login')}
                            </label>
                        </div>
                        {/if}
                        <div class="form-group">
                            <button type="submit" class="btn btn-success btn-lg btn-block" style="background:#708eea;">{:__('Sign in')}</button>
                        </div>
                        <!--@AdminLoginFormEnd-->
                    </form>
                </div>

            </div>
        </div>
    </div>


</div>
<div class="col-xs-12 col-sm-12 text-center"  style="margin-top: 100px">
    <p>Copyright © 2024 {:$Think.config.site.name} All Rights Reserved</p>
</div>
{include file="common/script" /}
</body>
</html>
相关推荐
福兮说10 小时前
设计稿是 #4A7C6F,页面量出来是 #4B7C6F:HEX、HSL、透明度、canvas 来回转的七个坑
前端·javascript·css·canvas
凤城老人11 小时前
从 PyQt6 到 Electron:给 Edge TTS 做一个“多角色配音机“的踩坑手记
javascript·typescript·electron
Dovis(誓平步青云)11 小时前
浇水提醒刚弹出又消失,植物状态别只存一个百分比
开发语言·前端·javascript·pdf·ecmascript·电脑
码艺-Alimjan12 小时前
Vben Admin 新增维吾尔语 Vben-Modal的关键坑之一
前端·javascript·vue.js
可乐鸡翅yeah_12 小时前
hls.js 手动自定义 http 请求 loader,修改请求头实战
开发语言·前端·javascript·网络协议·http·ecmascript·m3u8在线
yivifu14 小时前
中文古籍电子书注释集成
前端·javascript·python·beautifulsoup·epub
weixin_4482902514 小时前
书庐开发实战教学
javascript·css·html
默_笙14 小时前
🛴 从散件到整机:DeepAgents 与 Agent 身上预留的那些"插槽"(前置介绍)
前端·javascript
一木 之林15 小时前
DeepSeek Agent 开发(一)
开发语言·前端·javascript
樱花落木兰17 小时前
分布式登录实战:Session 会话共享改造,Redis 存储用户登录状态
java·javascript·数据库·redis·分布式·缓存