增加登录背景图片配置

This commit is contained in:
邹景立 2021-10-16 14:57:16 +08:00
parent c91dfac095
commit 4afdef411e
4 changed files with 20 additions and 4 deletions

View File

@ -47,6 +47,7 @@ class Login extends Controller
$this->captchaType = 'LoginCaptcha'; $this->captchaType = 'LoginCaptcha';
$this->captchaToken = CodeExtend::uniqidDate(18); $this->captchaToken = CodeExtend::uniqidDate(18);
$this->developmentMode = SystemService::instance()->checkRunMode(); $this->developmentMode = SystemService::instance()->checkRunMode();
$this->loginBackground = str_replace('|', ',', sysconf('login_image') ?: '');
// 刷新当前后台域名 // 刷新当前后台域名
$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);

View File

@ -2,8 +2,8 @@
<div class="layui-card-body padding-left-40"> <div class="layui-card-body padding-left-40">
<div class="layui-form-item"> <div class="layui-form-item">
<span class="color-green font-w7 label-required-prev">后台登录入口</span> <b class="color-green label-required-prev">后台登录入口</b>
<span class="color-desc margin-left-5">Login</span> <span class="color-desc margin-left-5">Login Entry</span>
<label class="layui-input relative block label-required-null"> <label class="layui-input relative block label-required-null">
<span>{:sysuri('@',[],false,true)}</span> <span>{:sysuri('@',[],false,true)}</span>
<input autofocus required pattern="[a-zA-Z_][a-zA-Z0-9_]*" placeholder="请输入后台登录入口" class="layui-input inline-block padding-0 border-0" style="width:auto;background:none" value="{:trim(sysuri('admin/index/index',[],false),'/')}" name="xpath"> <input autofocus required pattern="[a-zA-Z_][a-zA-Z0-9_]*" placeholder="请输入后台登录入口" class="layui-input inline-block padding-0 border-0" style="width:auto;background:none" value="{:trim(sysuri('admin/index/index',[],false),'/')}" name="xpath">
@ -11,8 +11,15 @@
<span class="help-block">名称由英文字母开头且不能存在相同名称的应用,设置之后原地址不能继续访问!</span> <span class="help-block">名称由英文字母开头且不能存在相同名称的应用,设置之后原地址不能继续访问!</span>
</div> </div>
<div class="layui-form-item">
<b class="color-green label-required-prev">登录界面背景</b>
<span class="color-desc margin-left-5">Login Background</span>
<div><input type="hidden" value="{:sysconf('login_image')}" name="login_image"></div>
<script>$('[name=login_image]').uploadMultipleImage();</script>
</div>
<label class="layui-form-item relative block"> <label class="layui-form-item relative block">
<span class="color-green font-w7">浏览器小图标</span> <b class="color-green">浏览器小图标</b>
<span class="color-desc margin-left-5">Icon</span> <span class="color-desc margin-left-5">Icon</span>
<input class="layui-input" required pattern="^(http|/)" placeholder="请上传浏览器图标" value="{:sysconf('site_icon')}" name="site_icon"> <input class="layui-input" required pattern="^(http|/)" placeholder="请上传浏览器图标" value="{:sysconf('site_icon')}" name="site_icon">
<a class="input-right-icon layui-icon layui-icon-upload-drag" style="top:25px" data-file="btn" data-type="ico,png" data-field="site_icon"></a> <a class="input-right-icon layui-icon layui-icon-upload-drag" style="top:25px" data-file="btn" data-type="ico,png" data-field="site_icon"></a>

View File

@ -1,7 +1,7 @@
{extend name="index/index"} {extend name="index/index"}
{block name="body"} {block name="body"}
<div class="login-container" data-supersized="__ROOT__/static/theme/img/login/bg1.jpg,__ROOT__/static/theme/img/login/bg2.jpg"> <div class="login-container" data-supersized="{$loginBackground|default='__ROOT__/static/theme/img/login/bg1.jpg,__ROOT__/static/theme/img/login/bg2.jpg'}">
<div class="header notselect layui-hide-xs"> <div class="header notselect layui-hide-xs">
<a href="{:url('@')}" class="title">{:sysconf('app_name')}<span>{:sysconf('app_version')}</span></a> <a href="{:url('@')}" class="title">{:sysconf('app_name')}<span>{:sysconf('app_version')}</span></a>
{notempty name='developmentMode'} {notempty name='developmentMode'}

View File

@ -217,13 +217,16 @@ class Order extends Auth
'code.require' => '地址不能为空', 'code.require' => '地址不能为空',
'order_no.require' => '单号不能为空', 'order_no.require' => '单号不能为空',
]); ]);
// 用户收货地址 // 用户收货地址
$map = ['uuid' => $this->uuid, 'code' => $data['code']]; $map = ['uuid' => $this->uuid, 'code' => $data['code']];
$addr = DataUserAddress::mk()->where($map)->find(); $addr = DataUserAddress::mk()->where($map)->find();
if (empty($addr)) $this->error('收货地址异常'); if (empty($addr)) $this->error('收货地址异常');
// 订单状态检查 // 订单状态检查
$map = ['uuid' => $this->uuid, 'order_no' => $data['order_no']]; $map = ['uuid' => $this->uuid, 'order_no' => $data['order_no']];
$tCount = ShopOrderItem::mk()->where($map)->sum('truck_number'); $tCount = ShopOrderItem::mk()->where($map)->sum('truck_number');
// 根据地址计算运费 // 根据地址计算运费
$map = ['status' => 1, 'deleted' => 0, 'order_no' => $data['order_no']]; $map = ['status' => 1, 'deleted' => 0, 'order_no' => $data['order_no']];
$tCode = ShopOrderItem::mk()->where($map)->column('truck_code'); $tCode = ShopOrderItem::mk()->where($map)->column('truck_code');
@ -244,20 +247,24 @@ class Order extends Auth
'code.require' => '地址不能为空', 'code.require' => '地址不能为空',
'order_no.require' => '单号不能为空', 'order_no.require' => '单号不能为空',
]); ]);
// 用户收货地址 // 用户收货地址
$map = ['uuid' => $this->uuid, 'code' => $data['code'], 'deleted' => 0]; $map = ['uuid' => $this->uuid, 'code' => $data['code'], 'deleted' => 0];
$addr = DataUserAddress::mk()->where($map)->find(); $addr = DataUserAddress::mk()->where($map)->find();
if (empty($addr)) $this->error('收货地址异常'); if (empty($addr)) $this->error('收货地址异常');
// 订单状态检查 // 订单状态检查
$map1 = ['uuid' => $this->uuid, 'order_no' => $data['order_no']]; $map1 = ['uuid' => $this->uuid, 'order_no' => $data['order_no']];
$order = ShopOrder::mk()->where($map1)->whereIn('status', [1, 2])->find(); $order = ShopOrder::mk()->where($map1)->whereIn('status', [1, 2])->find();
if (empty($order)) $this->error('不能修改地址'); if (empty($order)) $this->error('不能修改地址');
if (empty($order['truck_type'])) $this->success('无需快递配送', ['order_no' => $order['order_no']]); if (empty($order['truck_type'])) $this->success('无需快递配送', ['order_no' => $order['order_no']]);
// 根据地址计算运费 // 根据地址计算运费
$map2 = ['status' => 1, 'deleted' => 0, 'order_no' => $data['order_no']]; $map2 = ['status' => 1, 'deleted' => 0, 'order_no' => $data['order_no']];
$tCount = ShopOrderItem::mk()->where($map1)->sum('truck_number'); $tCount = ShopOrderItem::mk()->where($map1)->sum('truck_number');
$tCodes = ShopOrderItem::mk()->where($map2)->column('truck_code'); $tCodes = ShopOrderItem::mk()->where($map2)->column('truck_code');
[$amount, $tCount, $tCode, $remark] = ExpressService::instance()->amount($tCodes, $addr['province'], $addr['city'], $tCount); [$amount, $tCount, $tCode, $remark] = ExpressService::instance()->amount($tCodes, $addr['province'], $addr['city'], $tCount);
// 创建订单发货信息 // 创建订单发货信息
$express = [ $express = [
'template_code' => $tCode, 'template_count' => $tCount, 'uuid' => $this->uuid, 'template_code' => $tCode, 'template_count' => $tCount, 'uuid' => $this->uuid,
@ -280,6 +287,7 @@ class Order extends Auth
$express['address_area'] = $addr['area']; $express['address_area'] = $addr['area'];
$express['address_content'] = $addr['address']; $express['address_content'] = $addr['address'];
ShopOrderSend::mUpdate($express, 'order_no');
data_save(ShopOrderSend::class, $express, 'order_no'); data_save(ShopOrderSend::class, $express, 'order_no');
// 组装更新订单数据 // 组装更新订单数据
$update = ['status' => 2, 'amount_express' => $express['template_amount']]; $update = ['status' => 2, 'amount_express' => $express['template_amount']];