[更新]修改后台样式

This commit is contained in:
Anyon 2019-08-01 15:04:11 +08:00
parent b4124fd8f7
commit c1d4a90b9d
6 changed files with 148 additions and 92 deletions

View File

@ -38,26 +38,22 @@ class Config extends Controller
*/
public function index()
{
$this->applyCsrfToken('save');
$this->title = '开放平台配置';
$this->fetch();
}
/**
* 保存参数数据
* @auth true
* @throws \think\Exception
* @throws \think\exception\PDOException
* 编辑平台配置
*/
public function save()
public function edit()
{
$this->applyCsrfToken('save');
if ($this->request->post()) {
$this->applyCsrfToken();
if ($this->request->isGet()) {
$this->fetch('form');
} else {
$post = $this->request->post();
foreach ($post as $k => $v) sysconf($k, $v);
$this->success('开放平台参数修改成功!');
} else {
$this->error('开放平台参数修改失败!');
}
}

View File

@ -0,0 +1,44 @@
<form onsubmit="return false;" action="{:request()->url()}" data-auto="true" method="post" class='layui-form layui-card' autocomplete="off">
<div class="layui-card-body padding-left-40">
<div class="layui-form-item">
<label class="relative block">
<span class="color-green font-w700">开放平台服务 AppID</span>
<input name="component_appid" required pattern="^.{18}$" maxlength="18" placeholder="请输入18位开放平台服务AppID" value="{:sysconf('component_appid')}" class="layui-input">
</label>
<p class="help-block">开放平台服务 AppID需要在微信开放平台获取</p>
</div>
<div class="layui-form-item">
<label class="relative block">
<span class="color-green font-w700">开放平台服务 AppSecret</span>
<input name="component_appsecret" required pattern="^.{32}$" maxlength="32" placeholder="请输入32位开放平台服务AppSecret" value="{:sysconf('component_appsecret')}" class="layui-input">
</label>
<p class="help-block">开放平台服务 AppSecret需要在微信开放平台获取</p>
</div>
<div class="layui-form-item">
<label class="relative block">
<span class="color-green font-w700">开放平台消息校验 Token</span>
<input name="component_token" required placeholder="请输入微信消息校验Token" value="{:sysconf('component_token')}" class="layui-input">
</label>
<p class="help-block">开发者在代替微信接收到消息时,用此 Token 来校验消息</p>
</div>
<div class="layui-form-item">
<label class="relative block">
<span class="color-green font-w700">开放平台消息加解密 AesKey</span>
<input name="component_encodingaeskey" required pattern="^.{43}$" maxlength="43" placeholder="请输入43位微信消息加解密Key" value="{:sysconf('component_encodingaeskey')}" class="layui-input">
</label>
<p class="help-block">在代替微信收发消息时使用必须是长度为43位字母和数字组合的字符串</p>
</div>
<div class="hr-line-dashed"></div>
<div class="text-center padding-bottom-15 margin-bottom-20">
<button class="layui-btn" type="submit">保存配置</button>
</div>
</div>
</form>

View File

@ -1,56 +1,58 @@
{extend name="admin@main"}
{block name="button"}
{if auth("service/config/edit")}
<button data-modal="{:url('edit')}" class='layui-btn layui-btn-sm layui-btn-primary'>参数配置</button>
{/if}
{/block}
{block name="content"}
<div class="relative">
<div class="think-box-shadow border-0 margin-bottom-20">
<div class="think-box-shadow border-0 margin-bottom-15">
强烈建议安装 YAR 扩展来实现接口通信SOAP 不能正常显示接口的异常信息
</div>
<div class="layui-row layui-col-space15">
<div class="layui-col-lg6">
<fieldset class="think-box-shadow">
<legend class="layui-bg-cyan">授权参数</legend>
<form onsubmit="return false;" action="{:url('save')}" data-auto="true" method="post" class='layui-form padding-left-20 padding-right-20' autocomplete="off">
<div class="think-box-shadow padding-right-40 padding-left-40">
<div class="layui-row layui-col-space18">
<div class="layui-col-md6">
<div class="layui-form-item">
<p class="color-green">开放平台服务 AppID</p>
<label class="relative block">
<span class="color-green">开放平台服务 AppID</span>
<input name="component_appid" required pattern="^.{18}$" maxlength="18" placeholder="请输入18位开放平台服务AppID" value="{:sysconf('component_appid')}" class="layui-input">
<input disabled class="layui-input layui-bg-gray" value="{:sysconf('component_appid')}">
<a data-copy="{:sysconf('component_appid')}" class="fa fa-copy right-btn"></a>
</label>
<p class="help-block">开放平台服务 AppID需要在微信开放平台获取</p>
</div>
<div class="layui-form-item">
<p class="color-green">开放平台服务 AppSecret</p>
<label class="relative block">
<span class="color-green">开放平台服务 AppSecret</span>
<input name="component_appsecret" required pattern="^.{32}$" maxlength="32" placeholder="请输入32位开放平台服务AppSecret" value="{:sysconf('component_appsecret')}" class="layui-input">
<input disabled class="layui-input layui-bg-gray" value="{:sysconf('component_appsecret')}">
<a data-copy="{:sysconf('component_appsecret')}" class="fa fa-copy right-btn"></a>
</label>
<p class="help-block">开放平台服务 AppSecret需要在微信开放平台获取</p>
</div>
<div class="layui-form-item">
<p class="color-green">开放平台消息校验 Token</p>
<label class="relative block">
<span class="color-green">开放平台消息校验 Token</span>
<input name="component_token" required placeholder="请输入微信消息校验Token" value="{:sysconf('component_token')}" class="layui-input">
<input disabled class="layui-input layui-bg-gray" value="{:sysconf('component_token')}">
<a data-copy="{:sysconf('component_token')}" class="fa fa-copy right-btn"></a>
</label>
<p class="help-block">开发者在代替微信接收到消息时,用此 Token 来校验消息</p>
</div>
<div class="layui-form-item">
<p class="color-green">开放平台消息加解密 AesKey</p>
<label class="relative block">
<span class="color-green">开放平台消息加解密 AesKey</span>
<input name="component_encodingaeskey" required pattern="^.{43}$" maxlength="43" placeholder="请输入43位微信消息加解密Key" value="{:sysconf('component_encodingaeskey')}" class="layui-input">
<input disabled class="layui-input layui-bg-gray" value="{:sysconf('component_encodingaeskey')}">
<a data-copy="{:sysconf('component_encodingaeskey')}" class="fa fa-copy right-btn"></a>
</label>
<p class="help-block">在代替微信收发消息时使用必须是长度为43位字母和数字组合的字符串</p>
</div>
<div class="hr-line-dashed"></div>
<div class="text-center padding-bottom-15 margin-bottom-20">
<button class="layui-btn" type="submit">保存配置</button>
</div>
</form>
</fieldset>
</div>
<div class="layui-col-lg6">
<fieldset class="think-box-shadow">
<legend class="layui-bg-cyan">对接信息</legend>
<div class="padding-right-20 padding-left-20">
<div class="layui-col-md6">
<div class="layui-form-item">
<p class="color-green">授权发起页域名</p>
<label class="relative block">
@ -86,7 +88,6 @@
<p class="help-block">客户端 Soap 接口PARAM 规则 AppName-AppId-AppKey-AppType</p>
</div>
</div>
</fieldset>
</div>
</div>

View File

@ -846,6 +846,12 @@ label.think-radio {
.font-s40 {
font-size: 40px !important;
}
.font-w400 {
font-weight: 400 !important;
}
.font-w700 {
font-weight: 700 !important;
}
.padding-0 {
padding: 0 !important;
}
@ -1180,3 +1186,4 @@ label.think-radio {
[data-tips-image] {
cursor: zoom-in !important;
}
/*# sourceMappingURL=console.css.map */

File diff suppressed because one or more lines are too long

View File

@ -227,6 +227,14 @@
&s40 {
font-size: 40px !important
}
&w400 {
font-weight: 400 !important;
}
&w700 {
font-weight: 700 !important;
}
}
.padding {