同步更新

This commit is contained in:
邹景立 2023-02-20 14:29:17 +08:00
parent b8c7cccb39
commit 47fe336024
30 changed files with 397 additions and 270 deletions

3
.gitignore vendored
View File

@ -34,3 +34,6 @@
/database/migrations/20221013045838_install_user.php /database/migrations/20221013045838_install_user.php
/database/migrations/20221013045839_install_user_data.php /database/migrations/20221013045839_install_user_data.php
/database/migrations/20221013045840_install_user_region.php /database/migrations/20221013045840_install_user_region.php
/database/migrations/20221215000001_install_center_data.php
/database/migrations/20230219000001_install_table.php
/database/migrations/20230219000002_install_package.php

View File

@ -4,7 +4,7 @@
<label class="layui-form-item relative block"> <label class="layui-form-item relative block">
<span class="help-label"><b>权限名称</b>Permission Name</span> <span class="help-label"><b>权限名称</b>Permission Name</span>
<input maxlength="100" class="layui-input" name="title" value='{$vo.title|default=""}' required placeholder="请输入权限名称"> <input maxlength="100" class="layui-input" name="title" value='{$vo.title|default=""}' required vali-name="权限名称" placeholder="请输入权限名称">
<span class="help-block">访问权限名称需要保持不重复,在给用户授权时需要根据名称选择!</span> <span class="help-block">访问权限名称需要保持不重复,在给用户授权时需要根据名称选择!</span>
</label> </label>

View File

@ -29,7 +29,7 @@
{/if} {/if}
<p class="help-block">请选择数据类型,数据创建后不能再次修改哦 ~</p> <p class="help-block">请选择数据类型,数据创建后不能再次修改哦 ~</p>
<div id="DataTypeInput" class="layui-hide relative"> <div id="DataTypeInput" class="layui-hide relative">
<input class="layui-input" maxlength="20" name="type" required placeholder="请输入数据类型" value="{$vo.type|default=''}"> <input class="layui-input" maxlength="20" name="type" required vali-name="数据类型" placeholder="请输入数据类型" value="{$vo.type|default=''}">
<p class="help-block">请输入新的数据类型,数据创建后不能再次修改哦 ~</p> <p class="help-block">请输入新的数据类型,数据创建后不能再次修改哦 ~</p>
</div> </div>
</div> </div>
@ -37,16 +37,16 @@
<label class="layui-form-item relative block"> <label class="layui-form-item relative block">
<span class="help-label"><b>数据编码</b>DataCode</span> <span class="help-label"><b>数据编码</b>DataCode</span>
{if isset($vo.code)} {if isset($vo.code)}
<input readonly maxlength="100" class="layui-input think-bg-gray" name="code" value='{$vo.code|default=""}' required placeholder="请输入数据编码"> <input readonly maxlength="100" class="layui-input think-bg-gray" name="code" value='{$vo.code|default=""}' required required-error="数据编码不能为空" placeholder="请输入数据编码">
{else} {else}
<input maxlength="100" class="layui-input" name="code" value='{$vo.code|default=""}' required placeholder="请输入数据编码"> <input maxlength="100" class="layui-input" name="code" value='{$vo.code|default=""}' required vali-name="数据编码" placeholder="请输入数据编码">
{/if} {/if}
<span class="help-block">请输入新的数据编码,数据创建后不能再次修改,同种数据类型的数据编码不能出现重复 ~</span> <span class="help-block">请输入新的数据编码,数据创建后不能再次修改,同种数据类型的数据编码不能出现重复 ~</span>
</label> </label>
<label class="layui-form-item relative block"> <label class="layui-form-item relative block">
<span class="help-label"><b>数据名称</b>DataName</span> <span class="help-label"><b>数据名称</b>DataName</span>
<input maxlength="500" class="layui-input" name="name" value='{$vo.name|default=""}' required placeholder="请输入数据名称"> <input maxlength="500" class="layui-input" name="name" value='{$vo.name|default=""}' required vali-name="数据名称" placeholder="请输入数据名称">
<span class="help-block">请输入当前数据名称,请尽量保持名称的唯一性,数据名称尽量不要出现重复 ~</span> <span class="help-block">请输入当前数据名称,请尽量保持名称的唯一性,数据名称尽量不要出现重复 ~</span>
</label> </label>

View File

@ -39,7 +39,7 @@
<b class="color-green">允许类型</b><br><span class="nowrap color-desc">AllowExts</span> <b class="color-green">允许类型</b><br><span class="nowrap color-desc">AllowExts</span>
</label> </label>
<div class="layui-input-block"> <div class="layui-input-block">
<input id="storage.allow_exts" type="text" name="storage.allow_exts" required value="{:sysconf('storage.allow_exts')}" placeholder="请输入系统文件上传后缀" class="layui-input"> <input id="storage.allow_exts" type="text" name="storage.allow_exts" value="{:sysconf('storage.allow_exts')}" required vali-name="文件后缀" placeholder="请输入系统文件上传后缀" class="layui-input">
<p class="help-block">设置系统允许上传文件的后缀多个以英文逗号隔开如png,jpg,rar,doc未设置允许上传的后缀</p> <p class="help-block">设置系统允许上传文件的后缀多个以英文逗号隔开如png,jpg,rar,doc未设置允许上传的后缀</p>
</div> </div>
</div> </div>

View File

@ -49,7 +49,7 @@
<b class="color-green">空间名称</b><br><span class="nowrap color-desc">Bucket</span> <b class="color-green">空间名称</b><br><span class="nowrap color-desc">Bucket</span>
</label> </label>
<div class="layui-input-block"> <div class="layui-input-block">
<input id="storage.alioss_bucket" type="text" name="storage.alioss_bucket" required value="{:sysconf('storage.alioss_bucket')}" placeholder="请输入阿里云OSS存储 Bucket (空间名称)" class="layui-input"> <input id="storage.alioss_bucket" type="text" name="storage.alioss_bucket" value="{:sysconf('storage.alioss_bucket')}" required vali-name="空间名称" placeholder="请输入阿里云OSS存储 Bucket (空间名称)" class="layui-input">
<p class="help-block">填写阿里云OSS存储空间名称think-admin-oss需要是全区唯一的值不存在时会自动创建</p> <p class="help-block">填写阿里云OSS存储空间名称think-admin-oss需要是全区唯一的值不存在时会自动创建</p>
</div> </div>
</div> </div>
@ -59,7 +59,7 @@
<b class="color-green">访问域名</b><br><span class="nowrap color-desc">Domain</span> <b class="color-green">访问域名</b><br><span class="nowrap color-desc">Domain</span>
</label> </label>
<div class="layui-input-block"> <div class="layui-input-block">
<input id="storage.alioss_http_domain" type="text" name="storage.alioss_http_domain" required value="{:sysconf('storage.alioss_http_domain')}" placeholder="请输入阿里云OSS存储 Domain (访问域名)" class="layui-input"> <input id="storage.alioss_http_domain" type="text" name="storage.alioss_http_domain" value="{:sysconf('storage.alioss_http_domain')}" required vali-name="访问域名" placeholder="请输入阿里云OSS存储 Domain (访问域名)" class="layui-input">
<p class="help-block">填写阿里云OSS存储外部访问域名static.alioss.thinkadmin.top</p> <p class="help-block">填写阿里云OSS存储外部访问域名static.alioss.thinkadmin.top</p>
</div> </div>
</div> </div>
@ -69,7 +69,7 @@
<b class="color-green">访问密钥</b><br><span class="nowrap color-desc">AccessKey</span> <b class="color-green">访问密钥</b><br><span class="nowrap color-desc">AccessKey</span>
</label> </label>
<div class="layui-input-block"> <div class="layui-input-block">
<input id="storage.alioss_access_key" type="text" name="storage.alioss_access_key" required value="{:sysconf('storage.alioss_access_key')}" placeholder="请输入阿里云OSS存储 AccessKey (访问密钥)" class="layui-input"> <input id="storage.alioss_access_key" type="text" name="storage.alioss_access_key" value="{:sysconf('storage.alioss_access_key')}" required vali-name="访问密钥" placeholder="请输入阿里云OSS存储 AccessKey (访问密钥)" class="layui-input">
<p class="help-block">可以在 [ 阿里云 > 个人中心 ] 设置并获取到访问密钥</p> <p class="help-block">可以在 [ 阿里云 > 个人中心 ] 设置并获取到访问密钥</p>
</div> </div>
</div> </div>
@ -79,7 +79,7 @@
<b class="color-green">安全密钥</b><br><span class="nowrap color-desc">SecretKey</span> <b class="color-green">安全密钥</b><br><span class="nowrap color-desc">SecretKey</span>
</label> </label>
<div class="layui-input-block"> <div class="layui-input-block">
<input id="storage.alioss_secret_key" type="text" name="storage.alioss_secret_key" required value="{:sysconf('storage.alioss_secret_key')}" maxlength="43" placeholder="请输入阿里云OSS存储 SecretKey (安全密钥)" class="layui-input"> <input id="storage.alioss_secret_key" type="text" name="storage.alioss_secret_key" value="{:sysconf('storage.alioss_secret_key')}" maxlength="43" required vali-name="安全密钥" placeholder="请输入阿里云OSS存储 SecretKey (安全密钥)" class="layui-input">
<p class="help-block">可以在 [ 阿里云 > 个人中心 ] 设置并获取到安全密钥</p> <p class="help-block">可以在 [ 阿里云 > 个人中心 ] 设置并获取到安全密钥</p>
</div> </div>
</div> </div>

View File

@ -49,7 +49,7 @@
<b class="color-green">空间名称</b><br><span class="nowrap color-desc">Bucket</span> <b class="color-green">空间名称</b><br><span class="nowrap color-desc">Bucket</span>
</label> </label>
<div class="layui-input-block"> <div class="layui-input-block">
<input id="storage.qiniu_bucket" type="text" name="storage.qiniu_bucket" required value="{:sysconf('storage.qiniu_bucket')}" placeholder="请输入七牛云存储 Bucket (空间名称)" class="layui-input"> <input id="storage.qiniu_bucket" type="text" name="storage.qiniu_bucket" value="{:sysconf('storage.qiniu_bucket')}" required vali-name="空间名称" placeholder="请输入七牛云存储 Bucket (空间名称)" class="layui-input">
<p class="help-block">填写七牛云存储空间名称static</p> <p class="help-block">填写七牛云存储空间名称static</p>
</div> </div>
</div> </div>
@ -59,7 +59,7 @@
<b class="color-green">访问域名</b><br><span class="nowrap color-desc">Domain</span> <b class="color-green">访问域名</b><br><span class="nowrap color-desc">Domain</span>
</label> </label>
<div class="layui-input-block"> <div class="layui-input-block">
<input id="storage.qiniu_http_domain" type="text" name="storage.qiniu_http_domain" required value="{:sysconf('storage.qiniu_http_domain')}" placeholder="请输入七牛云存储 Domain (访问域名)" class="layui-input"> <input id="storage.qiniu_http_domain" type="text" name="storage.qiniu_http_domain" value="{:sysconf('storage.qiniu_http_domain')}" required vali-name="访问域名" placeholder="请输入七牛云存储 Domain (访问域名)" class="layui-input">
<p class="help-block">填写七牛云存储访问域名static.qiniu.thinkadmin.top</p> <p class="help-block">填写七牛云存储访问域名static.qiniu.thinkadmin.top</p>
</div> </div>
</div> </div>
@ -69,7 +69,7 @@
<b class="color-green">访问密钥</b><br><span class="nowrap color-desc">AccessKey</span> <b class="color-green">访问密钥</b><br><span class="nowrap color-desc">AccessKey</span>
</label> </label>
<div class="layui-input-block"> <div class="layui-input-block">
<input id="storage.qiniu_access_key" type="text" name="storage.qiniu_access_key" required value="{:sysconf('storage.qiniu_access_key')}" placeholder="请输入七牛云授权 AccessKey (访问密钥)" class="layui-input"> <input id="storage.qiniu_access_key" type="text" name="storage.qiniu_access_key" value="{:sysconf('storage.qiniu_access_key')}" required vali-name="访问密钥" placeholder="请输入七牛云授权 AccessKey (访问密钥)" class="layui-input">
<p class="help-block">可以在 [ 七牛云 > 个人中心 ] 设置并获取到访问密钥</p> <p class="help-block">可以在 [ 七牛云 > 个人中心 ] 设置并获取到访问密钥</p>
</div> </div>
</div> </div>
@ -79,7 +79,7 @@
<b class="color-green">安全密钥</b><br><span class="nowrap color-desc">SecretKey</span> <b class="color-green">安全密钥</b><br><span class="nowrap color-desc">SecretKey</span>
</label> </label>
<div class="layui-input-block"> <div class="layui-input-block">
<input id="storage.qiniu_secret_key" type="text" name="storage.qiniu_secret_key" required value="{:sysconf('storage.qiniu_secret_key')}" maxlength="43" placeholder="请输入七牛云授权 SecretKey (安全密钥)" class="layui-input"> <input id="storage.qiniu_secret_key" type="text" name="storage.qiniu_secret_key" value="{:sysconf('storage.qiniu_secret_key')}" maxlength="43" required vali-name="安全密钥" placeholder="请输入七牛云授权 SecretKey (安全密钥)" class="layui-input">
<p class="help-block">可以在 [ 七牛云 > 个人中心 ] 设置并获取到安全密钥</p> <p class="help-block">可以在 [ 七牛云 > 个人中心 ] 设置并获取到安全密钥</p>
</div> </div>
</div> </div>

View File

@ -49,7 +49,7 @@
<b class="color-green">空间名称</b><br><span class="nowrap color-desc">Bucket</span> <b class="color-green">空间名称</b><br><span class="nowrap color-desc">Bucket</span>
</label> </label>
<div class="layui-input-block"> <div class="layui-input-block">
<input id="storage.txcos_bucket" type="text" name="storage.txcos_bucket" required value="{:sysconf('storage.txcos_bucket')}" placeholder="请输入腾讯云COS存储 Bucket" class="layui-input"> <input id="storage.txcos_bucket" type="text" name="storage.txcos_bucket" value="{:sysconf('storage.txcos_bucket')}" required vali-name="空间名称" placeholder="请输入腾讯云COS存储 Bucket" class="layui-input">
<p class="help-block">填写腾讯云COS存储空间名称thinkadmin-1251143395</p> <p class="help-block">填写腾讯云COS存储空间名称thinkadmin-1251143395</p>
</div> </div>
</div> </div>
@ -59,7 +59,7 @@
<b class="color-green">访问域名</b><br><span class="nowrap color-desc">Domain</span> <b class="color-green">访问域名</b><br><span class="nowrap color-desc">Domain</span>
</label> </label>
<div class="layui-input-block"> <div class="layui-input-block">
<input id="storage.txcos_http_domain" type="text" name="storage.txcos_http_domain" required value="{:sysconf('storage.txcos_http_domain')}" placeholder="请输入腾讯云COS存储 Domain" class="layui-input"> <input id="storage.txcos_http_domain" type="text" name="storage.txcos_http_domain" value="{:sysconf('storage.txcos_http_domain')}" required vali-name="访问域名" placeholder="请输入腾讯云COS存储 Domain" class="layui-input">
<p class="help-block">填写腾讯云COS存储外部访问域名static.txcos.thinkadmin.top</p> <p class="help-block">填写腾讯云COS存储外部访问域名static.txcos.thinkadmin.top</p>
</div> </div>
</div> </div>
@ -69,7 +69,7 @@
<b class="color-green">访问密钥</b><br><span class="nowrap color-desc">AccessKey</span> <b class="color-green">访问密钥</b><br><span class="nowrap color-desc">AccessKey</span>
</label> </label>
<div class="layui-input-block"> <div class="layui-input-block">
<input id="storage.txcos_access_key" type="text" name="storage.txcos_access_key" required value="{:sysconf('storage.txcos_access_key')}" placeholder="请输入腾讯云COS存储 AccessKey" class="layui-input"> <input id="storage.txcos_access_key" type="text" name="storage.txcos_access_key" value="{:sysconf('storage.txcos_access_key')}" required vali-name="访问密钥" placeholder="请输入腾讯云COS存储 AccessKey" class="layui-input">
<p class="help-block">可以在 [ 腾讯云 > 个人中心 ] 设置并获取到访问密钥</p> <p class="help-block">可以在 [ 腾讯云 > 个人中心 ] 设置并获取到访问密钥</p>
</div> </div>
</div> </div>
@ -79,7 +79,7 @@
<b class="color-green">安全密钥</b><br><span class="nowrap color-desc">SecretKey</span> <b class="color-green">安全密钥</b><br><span class="nowrap color-desc">SecretKey</span>
</label> </label>
<div class="layui-input-block"> <div class="layui-input-block">
<input id="storage.txcos_secret_key" type="text" name="storage.txcos_secret_key" required value="{:sysconf('storage.txcos_secret_key')}" maxlength="43" placeholder="请输入腾讯云COS存储 SecretKey" class="layui-input"> <input id="storage.txcos_secret_key" type="text" name="storage.txcos_secret_key" value="{:sysconf('storage.txcos_secret_key')}" maxlength="43" required vali-name="安全密钥" placeholder="请输入腾讯云COS存储 SecretKey" class="layui-input">
<p class="help-block">可以在 [ 腾讯云 > 个人中心 ] 设置并获取到安全密钥</p> <p class="help-block">可以在 [ 腾讯云 > 个人中心 ] 设置并获取到安全密钥</p>
</div> </div>
</div> </div>

View File

@ -32,7 +32,7 @@
<b class="color-green">空间名称</b><br><span class="nowrap color-desc">Bucket</span> <b class="color-green">空间名称</b><br><span class="nowrap color-desc">Bucket</span>
</label> </label>
<div class="layui-input-block"> <div class="layui-input-block">
<input id="storage.upyun_bucket" name="storage.upyun_bucket" required value="{:sysconf('storage.upyun_bucket')}" placeholder="请输入又拍云存储 Bucket (空间名称)" class="layui-input"> <input id="storage.upyun_bucket" name="storage.upyun_bucket" value="{:sysconf('storage.upyun_bucket')}" required vali-name="空间名称" placeholder="请输入又拍云存储 Bucket (空间名称)" class="layui-input">
<p class="help-block">填写又拍云存储空间名称think-admin-uss需要是全区唯一的值不存在时会自动创建</p> <p class="help-block">填写又拍云存储空间名称think-admin-uss需要是全区唯一的值不存在时会自动创建</p>
</div> </div>
</div> </div>
@ -42,7 +42,7 @@
<b class="color-green">访问域名</b><br><span class="nowrap color-desc">Domain</span> <b class="color-green">访问域名</b><br><span class="nowrap color-desc">Domain</span>
</label> </label>
<div class="layui-input-block"> <div class="layui-input-block">
<input id="storage.upyun_http_domain" name="storage.upyun_http_domain" required value="{:sysconf('storage.upyun_http_domain')}" placeholder="请输入又拍云存储 Domain (访问域名)" class="layui-input"> <input id="storage.upyun_http_domain" name="storage.upyun_http_domain" value="{:sysconf('storage.upyun_http_domain')}" required vali-name="访问域名" placeholder="请输入又拍云存储 Domain (访问域名)" class="layui-input">
<p class="help-block">填写又拍云存储外部访问域名static.uss.thinkadmin.top</p> <p class="help-block">填写又拍云存储外部访问域名static.uss.thinkadmin.top</p>
</div> </div>
</div> </div>
@ -52,7 +52,7 @@
<b class="color-green">操作账号</b><br><span class="nowrap color-desc">Username</span> <b class="color-green">操作账号</b><br><span class="nowrap color-desc">Username</span>
</label> </label>
<div class="layui-input-block"> <div class="layui-input-block">
<input id="storage.upyun_access_key" name="storage.upyun_access_key" required value="{:sysconf('storage.upyun_access_key')}" maxlength="100" placeholder="请输入又拍云存储 Username (操作员账号)" class="layui-input"> <input id="storage.upyun_access_key" name="storage.upyun_access_key" value="{:sysconf('storage.upyun_access_key')}" maxlength="100" required vali-name="操作员账号" placeholder="请输入又拍云存储 Username (操作员账号)" class="layui-input">
<p class="help-block">可以在 [ 账户管理 > 操作员 ] 设置操作员账号并将空间给予授权。</p> <p class="help-block">可以在 [ 账户管理 > 操作员 ] 设置操作员账号并将空间给予授权。</p>
</div> </div>
</div> </div>
@ -62,7 +62,7 @@
<b class="color-green">操作密码</b><br><span class="nowrap color-desc">Password</span> <b class="color-green">操作密码</b><br><span class="nowrap color-desc">Password</span>
</label> </label>
<div class="layui-input-block"> <div class="layui-input-block">
<input id="storage.upyun_secret_key" name="storage.upyun_secret_key" required value="{:sysconf('storage.upyun_secret_key')}" maxlength="100" placeholder="请输入又拍云存储 Password (操作员密码)" class="layui-input"> <input id="storage.upyun_secret_key" name="storage.upyun_secret_key" value="{:sysconf('storage.upyun_secret_key')}" maxlength="100" required vali-name="操作员密码" placeholder="请输入又拍云存储 Password (操作员密码)" class="layui-input">
<p class="help-block">可以在 [ 账户管理 > 操作员 ] 设置操作员密码并将空间给予授权</p> <p class="help-block">可以在 [ 账户管理 > 操作员 ] 设置操作员密码并将空间给予授权</p>
</div> </div>
</div> </div>

View File

@ -5,14 +5,14 @@
<div class="layui-col-xs4 padding-bottom-0"> <div class="layui-col-xs4 padding-bottom-0">
<label class="relative block"> <label class="relative block">
<span class="help-label"><b>登录表单标题</b>Login Name</span> <span class="help-label"><b>登录表单标题</b>Login Name</span>
<input name="login_name" required placeholder="请输入登录页面的表单标题" value="{:sysconf('login_name')?:'系统管理'}" class="layui-input"> <input name="login_name" required placeholder="请输入登录页面的表单标题" vali-name="登录标题" value="{:sysconf('login_name')?:'系统管理'}" class="layui-input">
</label> </label>
</div> </div>
<div class="layui-col-xs4 padding-bottom-0"> <div class="layui-col-xs4 padding-bottom-0">
<div class="help-label label-required-prev"><b>后台登录入口</b>Login Entry</div> <div class="help-label label-required-prev"><b>后台登录入口</b>Login Entry</div>
<label class="layui-input relative block nowrap label-required-null"> <label class="layui-input relative block nowrap 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:100px;background:none" value="{:substr(sysuri('admin/index/index',[],false), strlen(sysuri('@')))}" name="xpath"> <input autofocus required pattern="[a-zA-Z_][a-zA-Z0-9_]*" vali-name="登录入口" placeholder="请输入后台登录入口" class="layui-input inline-block padding-0 border-0" style="width:100px;background:none" value="{:substr(sysuri('admin/index/index',[],false), strlen(sysuri('@')))}" name="xpath">
</label> </label>
</div> </div>
<div class="layui-col-xs4 padding-bottom-0"> <div class="layui-col-xs4 padding-bottom-0">
@ -40,7 +40,7 @@
<div class="layui-form-item margin-bottom-5"> <div class="layui-form-item margin-bottom-5">
<div class="help-label label-required-prev"><b>JWT 接口密钥</b>Jwt Key</div> <div class="help-label label-required-prev"><b>JWT 接口密钥</b>Jwt Key</div>
<label class="relative block label-required-null"> <label class="relative block label-required-null">
<input class="layui-input" pattern=".{32}" maxlength="32" required placeholder="请输入32位JWT接口密钥" name="data.jwtkey" value="{:sysconf('data.jwtkey')?:md5(uniqid(strval(rand(1000,9999)),true))}"> <input class="layui-input" pattern=".{32}" maxlength="32" required vali-name="接口密钥" placeholder="请输入32位JWT接口密钥" name="data.jwtkey" value="{:sysconf('data.jwtkey')?:md5(uniqid(strval(rand(1000,9999)),true))}">
<a class="input-right-icon layui-icon layui-icon-refresh" id="RefreshJwtKey"></a> <a class="input-right-icon layui-icon layui-icon-refresh" id="RefreshJwtKey"></a>
</label> </label>
<div class="help-block sub-span-blue"> <div class="help-block sub-span-blue">
@ -51,7 +51,7 @@
<div class="layui-form-item margin-bottom-5"> <div class="layui-form-item margin-bottom-5">
<div class="help-label label-required-prev"><b>浏览器小图标</b>Browser Icon</div> <div class="help-label label-required-prev"><b>浏览器小图标</b>Browser Icon</div>
<label class="relative block label-required-null"> <label class="relative block label-required-null">
<input class="layui-input" required pattern="^(http|/)" placeholder="请上传浏览器图标" value="{:sysconf('site_icon')}" name="site_icon"> <input class="layui-input" required pattern="url" vali-name="图标文件" placeholder="请上传浏览器图标" value="{:sysconf('site_icon')}" name="site_icon">
<a class="input-right-icon layui-icon layui-icon-upload-drag" data-file="btn" data-type="png,jpg,jpeg" data-field="site_icon"></a> <a class="input-right-icon layui-icon layui-icon-upload-drag" data-file="btn" data-type="png,jpg,jpeg" data-field="site_icon"></a>
</label> </label>
<div class="help-block sub-span-blue"> <div class="help-block sub-span-blue">
@ -63,14 +63,14 @@
<div class="layui-col-xs4 padding-bottom-0"> <div class="layui-col-xs4 padding-bottom-0">
<label class="layui-form-item margin-bottom-5 relative block"> <label class="layui-form-item margin-bottom-5 relative block">
<span class="help-label"><b>网站名称</b>Site Name</span> <span class="help-label"><b>网站名称</b>Site Name</span>
<input name="site_name" required placeholder="请输入网站名称" value="{:sysconf('site_name')}" class="layui-input"> <input name="site_name" required placeholder="请输入网站名称" vali-name="网站名称" value="{:sysconf('site_name')}" class="layui-input">
<span class="help-block">网站名称将显示在浏览器的标签上 ~</span> <span class="help-block">网站名称将显示在浏览器的标签上 ~</span>
</label> </label>
</div> </div>
<div class="layui-col-xs4 padding-bottom-0"> <div class="layui-col-xs4 padding-bottom-0">
<label class="layui-form-item margin-bottom-5 relative block"> <label class="layui-form-item margin-bottom-5 relative block">
<span class="help-label"><b>后台程序名称</b>App Name</span> <span class="help-label"><b>后台程序名称</b>App Name</span>
<input name="app_name" required placeholder="请输入程序名称" value="{:sysconf('app_name')}" class="layui-input"> <input name="app_name" required placeholder="请输入程序名称" vali-name="程序名称" value="{:sysconf('app_name')}" class="layui-input">
<span class="help-block">管理程序名称显示在后台左上标题处 ~</span> <span class="help-block">管理程序名称显示在后台左上标题处 ~</span>
</label> </label>
</div> </div>
@ -96,7 +96,7 @@
<div class="layui-col-xs4 padding-top-0 padding-bottom-0"> <div class="layui-col-xs4 padding-top-0 padding-bottom-0">
<label class="relative block"> <label class="relative block">
<span class="help-label"><b>网站版权信息</b>Copyright</span> <span class="help-label"><b>网站版权信息</b>Copyright</span>
<input name="site_copy" required placeholder="请输入版权信息" value="{:sysconf('site_copy')}" class="layui-input"> <input name="site_copy" required placeholder="请输入版权信息" vali-name="版权信息" value="{:sysconf('site_copy')}" class="layui-input">
</label> </label>
</div> </div>
<div class="layui-col-xs12 help-block padding-top-0"> <div class="layui-col-xs12 help-block padding-top-0">

View File

@ -4,7 +4,7 @@
<label class="layui-form-item relative block"> <label class="layui-form-item relative block">
<span class="help-label"><b>文件名称</b>Name</span> <span class="help-label"><b>文件名称</b>Name</span>
<input maxlength="100" class="layui-input" name="name" value='{$vo.name|default=""}' required placeholder="请输入文件名称"> <input maxlength="100" class="layui-input" name="name" value='{$vo.name|default=""}' required vali-name="文件名称" placeholder="请输入文件名称">
</label> </label>
<label class="layui-form-item relative block"> <label class="layui-form-item relative block">

View File

@ -22,19 +22,19 @@
<li class="username"> <li class="username">
<label class="label-required-null"> <label class="label-required-null">
<i class="layui-icon layui-icon-username"></i> <i class="layui-icon layui-icon-username"></i>
<input class="layui-input" required pattern="^\S{4,}$" name="username" autofocus autocomplete="off" placeholder="登录账号" title="请输入登录账号"> <input class="layui-input" required pattern="^\S{4,}$" vali-name="登录账号" name="username" autofocus autocomplete="off" placeholder="登录账号">
</label> </label>
</li> </li>
<li class="password"> <li class="password">
<label class="label-required-null"> <label class="label-required-null">
<i class="layui-icon layui-icon-password"></i> <i class="layui-icon layui-icon-password"></i>
<input class="layui-input" required pattern="^\S{4,}$" name="password" maxlength="32" type="password" autocomplete="off" placeholder="登录密码" title="请输入登录密码"> <input class="layui-input" required pattern="^\S{4,}$" vali-name="登录密码" name="password" maxlength="32" type="password" autocomplete="off" placeholder="登录密码">
</label> </label>
</li> </li>
<li class="verify layui-hide"> <li class="verify layui-hide">
<label class="inline-block relative label-required-null"> <label class="inline-block relative label-required-null">
<i class="layui-icon layui-icon-picture-fine"></i> <i class="layui-icon layui-icon-picture-fine"></i>
<input class="layui-input" required pattern="^\S{4,}$" name="verify" maxlength="4" autocomplete="off" placeholder="验证码" title="请输入验证码"> <input class="layui-input" required pattern="^\S{4,}$" name="verify" maxlength="4" autocomplete="off" vali-name="验证码" placeholder="验证码">
</label> </label>
<label data-captcha="{:url('admin/login/captcha',[],false)}" data-field-verify="verify" data-field-uniqid="uniqid" data-captcha-type="{$captchaType}" data-captcha-token="{$captchaToken}"></label> <label data-captcha="{:url('admin/login/captcha',[],false)}" data-field-verify="verify" data-field-uniqid="uniqid" data-captcha-type="{$captchaType}" data-captcha-token="{$captchaToken}"></label>
</li> </li>

View File

@ -19,7 +19,7 @@
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">菜单名称</label> <label class="layui-form-label">菜单名称</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input name="title" value='{$vo.title|default=""}' required placeholder="请输入菜单名称" class="layui-input"> <input name="title" value='{$vo.title|default=""}' required vali-name="菜单名称" placeholder="请输入菜单名称" class="layui-input">
<p class="help-block"><b>必选</b>,请填写菜单名称 ( 如:系统管理 ),建议字符不要太长,一般 4-6 个汉字</p> <p class="help-block"><b>必选</b>,请填写菜单名称 ( 如:系统管理 ),建议字符不要太长,一般 4-6 个汉字</p>
</div> </div>
</div> </div>
@ -27,7 +27,7 @@
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label">菜单链接</label> <label class="layui-form-label">菜单链接</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input onblur="this.value=this.value === ''?'#':this.value" name="url" required placeholder="请输入菜单链接" value="{$vo.url|default='#'}" class="layui-input"> <input onblur="this.value=this.value === ''?'#':this.value" name="url" required vali-name="菜单链接" placeholder="请输入菜单链接" value="{$vo.url|default='#'}" class="layui-input">
<p class="help-block"> <p class="help-block">
<b>必选</b>,请填写链接地址或选择系统节点 ( https://domain.com/admin/user/index.html admin/user/index ) <b>必选</b>,请填写链接地址或选择系统节点 ( https://domain.com/admin/user/index.html admin/user/index )
<br>当填写链接地址时,以下面的 “权限节点” 来判断菜单自动隐藏或显示,注意未填写 “权限节点” 时将不会隐藏该菜单哦 <br>当填写链接地址时,以下面的 “权限节点” 来判断菜单自动隐藏或显示,注意未填写 “权限节点” 时将不会隐藏该菜单哦

View File

@ -15,16 +15,16 @@
{if isset($vo) and isset($vo.username)} {if isset($vo) and isset($vo.username)}
<input disabled value='{$vo.username|default=""}' required class="layui-input think-bg-gray"> <input disabled value='{$vo.username|default=""}' required class="layui-input think-bg-gray">
{else} {else}
<input name="username" value='{$vo.username|default=""}' required pattern="^.{4,}$" placeholder="请输入登录账号" class="layui-input"> <input name="username" value='{$vo.username|default=""}' required pattern="^.{4,}$" vali-name="登录账号" placeholder="请输入登录账号" class="layui-input">
{/if} {/if}
<span class="help-block">登录账号不能重复并且创建后不能再次修改哦。</span> <span class="help-block">登录账号不能少于4位字符创建后不能再次修改.</span>
</label> </label>
</div> </div>
<div class="layui-col-xs5"> <div class="layui-col-xs5">
<label class="block relative"> <label class="block relative">
<span class="help-label"><b>用户名称</b>Nick Name</span> <span class="help-label"><b>用户名称</b>Nick Name</span>
<input name="nickname" value='{$vo.nickname|default=""}' required placeholder="请输入用户名称" class="layui-input"> <input name="nickname" value='{$vo.nickname|default=""}' required vali-name="用户名称" placeholder="请输入用户名称" class="layui-input">
<span class="help-block">用于区分用户数据的用户名称,请尽量不要重复</span> <span class="help-block">用于区分用户数据的用户名称,请尽量不要重复.</span>
</label> </label>
</div> </div>
</div> </div>
@ -77,21 +77,21 @@
<div class="layui-col-xs4"> <div class="layui-col-xs4">
<label class="relative block"> <label class="relative block">
<span class="help-label"><b>联系邮箱</b>Contact Email</span> <span class="help-label"><b>联系邮箱</b>Contact Email</span>
<input name="contact_mail" pattern="^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$" value='{$vo.contact_mail|default=""}' placeholder="请输入联系电子邮箱" class="layui-input"> <input name="contact_mail" value='{$vo.contact_mail|default=""}' pattern="_email_" vali-name="联系邮箱" placeholder="请输入联系电子邮箱" class="layui-input">
<span class="color-desc">可选,请填写用户常用的电子邮箱</span> <span class="color-desc">可选,请填写用户常用的电子邮箱</span>
</label> </label>
</div> </div>
<div class="layui-col-xs4"> <div class="layui-col-xs4">
<label class="relative block"> <label class="relative block">
<span class="help-label"><b>联系手机</b>Contact Mobile</span> <span class="help-label"><b>联系手机</b>Contact Mobile</span>
<input type="tel" maxlength="11" name="contact_phone" value='{$vo.contact_phone|default=""}' pattern="^1[3-9][0-9]{9}$" placeholder="请输入用户联系手机" class="layui-input"> <input type="tel" maxlength="11" name="contact_phone" value='{$vo.contact_phone|default=""}' pattern="phone" vali-name="联系手机" placeholder="请输入用户联系手机" class="layui-input">
<span class="color-desc">可选,请填写用户常用的联系手机号</span> <span class="color-desc">可选,请填写用户常用的联系手机号</span>
</label> </label>
</div> </div>
<div class="layui-col-xs4"> <div class="layui-col-xs4">
<label class="relative block"> <label class="relative block">
<span class="help-label"><b>联系QQ</b>Contact QQ</span> <span class="help-label"><b>联系QQ</b>Contact QQ</span>
<input name="contact_qq" pattern="^\d{6,}$" value='{$vo.contact_qq|default=""}' placeholder="请输入常用的联系QQ" class="layui-input"> <input name="contact_qq" maxlength="11" value='{$vo.contact_qq|default=""}' pattern="_qq_" vali-name="联系QQ" placeholder="请输入常用的联系QQ" class="layui-input">
<span class="color-desc">可选,请填写用户常用的联系QQ号</span> <span class="color-desc">可选,请填写用户常用的联系QQ号</span>
</label> </label>
</div> </div>

View File

@ -1,43 +1,33 @@
<form action="{:sysuri()}" method="post" data-auto="true" class="layui-form layui-card" data-table-id="UserTable"> <form action="{:sysuri()}" method="post" data-auto="true" class="layui-form layui-card" data-table-id="UserTable">
<div class="layui-card-body padding-left-40"> <div class="layui-card-body padding-left-40">
<div class="layui-form-item">
<label class="relative block"> <label class="layui-form-item relative block">
<span class="help-label"><b>登录用户账号</b>Username</span> <span class="help-label"><b>登录用户账号</b>Username</span>
<!--{if isset($vo) and isset($vo.username)}--> <input disabled value='{$vo.username|default=""}' class="layui-input think-bg-gray">
<input disabled value='{$vo.username|default=""}' class="layui-input think-bg-gray"> <span class="help-block">登录用户账号创建后,不允许再次修改。</span>
<!--{else}--> </label>
<input name="username" value='{$vo.username|default=""}' required pattern="^.{4,}$" placeholder="请输入4位及以上字符登录用户账号" class="layui-input">
<!--{/if}-->
</label>
<p class="help-block">登录用户账号创建后,不允许再次修改。</p>
</div>
<!--{if $verify}--> <!--{if $verify}-->
<div class="layui-form-item"> <label class="layui-form-item relative block">
<label class="relative block"> <span class="help-label"><b>旧的登录密码</b>Old Password</span>
<span class="help-label"><b>旧的登录密码</b>Old Password</span> <input type="password" autofocus name="oldpassword" value='' pattern="^\S{1,}$" required vali-name="验证密码" placeholder="请输入旧的登录密码" class="layui-input">
<input type="password" autofocus name="oldpassword" value='' pattern="^\S{1,}$" required placeholder="请输入旧的登录密码" class="layui-input"> <span class="color-desc">请输入旧密码来验证修改权限,旧密码不限制格式。</span>
</label> </label>
<p class="color-desc">请输入旧密码来验证修改权限,旧密码不限制格式。</p>
</div>
<!--{/if}--> <!--{/if}-->
<div class="layui-form-item"> <label class="layui-form-item relative block">
<label class="relative block"> <span class="help-label"><b>新的登录密码</b>New Password</span>
<span class="help-label"><b>新的登录密码</b>New Password</span> <input type="password" name="password" maxlength="32" pattern="^(?![\d]+$)(?![a-zA-Z]+$)(?![^\da-zA-Z]+$).{6,32}$" required vali-name="登录密码" placeholder="请输入新的登录密码" class="layui-input">
<input type="password" name="password" maxlength="32" pattern="^(?![\d]+$)(?![a-zA-Z]+$)(?![^\da-zA-Z]+$).{6,32}$" required placeholder="请输入新的登录密码" class="layui-input"> <span class="color-desc">密码必须包含大小写字母、数字、符号的任意两者组合。</span>
</label> </label>
<p class="color-desc">密码必须包含大小写字母、数字、符号的任意两者组合。</p>
</div> <label class="layui-form-item relative block">
<span class="help-label"><b>重复登录密码</b>Repeat Password</span>
<input type="password" name="repassword" maxlength="32" pattern="^(?![\d]+$)(?![a-zA-Z]+$)(?![^\da-zA-Z]+$).{6,32}$" required vali-name="重复密码" placeholder="请重复输入登录密码" class="layui-input">
<span class="color-desc">密码必须包含大小写字母、数字、符号的任意两者组合。</span>
</label>
<div class="layui-form-item">
<label class="relative block">
<span class="help-label"><b>重复登录密码</b>Repeat Password</span>
<input type="password" name="repassword" maxlength="32" pattern="^(?![\d]+$)(?![a-zA-Z]+$)(?![^\da-zA-Z]+$).{6,32}$" required placeholder="请重复输入登录密码" class="layui-input">
</label>
<p class="color-desc">密码必须包含大小写字母、数字、符号的任意两者组合。</p>
</div>
</div> </div>
<div class="hr-line-dashed"></div> <div class="hr-line-dashed"></div>

View File

@ -17,6 +17,7 @@
namespace app\wechat\controller; namespace app\wechat\controller;
use app\wechat\service\WechatService; use app\wechat\service\WechatService;
use think\admin\Builder;
use think\admin\Controller; use think\admin\Controller;
use think\admin\storage\LocalStorage; use think\admin\storage\LocalStorage;
@ -41,14 +42,18 @@ class Config extends Controller
$this->thrNotify = sysuri('wechat/api.push/index', [], false, true); $this->thrNotify = sysuri('wechat/api.push/index', [], false, true);
if ($this->request->isGet()) { if ($this->request->isGet()) {
try { try {
// 生成微信授权链接
$source = enbase64url(sysuri('admin/index/index', [], false, true) . '#' . $this->request->url()); $source = enbase64url(sysuri('admin/index/index', [], false, true) . '#' . $this->request->url());
$this->authurl = "https://open.cuci.cc/service/api.push/auth?source={$source}"; $authurl = sysconf('wechat.service_authurl|raw') ?: "https://open.cuci.cc/service/api.push/auth?source=SOURCE";
$this->authurl = str_replace('source=SOURCE', "source={$source}", $authurl);
// 授权成功后的参数保存
if (input('?appid') && input('?appkey')) { if (input('?appid') && input('?appkey')) {
sysconf('wechat.type', 'thr'); sysconf('wechat.type', 'thr');
sysconf('wechat.thr_appid', input('appid')); sysconf('wechat.thr_appid', input('appid'));
sysconf('wechat.thr_appkey', input('appkey')); sysconf('wechat.thr_appkey', input('appkey'));
WechatService::ThinkServiceConfig()->setApiNotifyUri($this->thrNotify); WechatService::ThinkServiceConfig()->setApiNotifyUri($this->thrNotify);
} }
// 读取授权的微信参数
$this->wechat = WechatService::ThinkServiceConfig()->getConfig(); $this->wechat = WechatService::ThinkServiceConfig()->getConfig();
} catch (\Exception $exception) { } catch (\Exception $exception) {
$this->wechat = []; $this->wechat = [];
@ -63,16 +68,13 @@ class Config extends Controller
$this->fetch(); $this->fetch();
} else { } else {
foreach ($this->request->post() as $k => $v) sysconf($k, $v); foreach ($this->request->post() as $k => $v) sysconf($k, $v);
if ($this->request->post('wechat.type') === 'thr') { if ($this->request->post('wechat.type') === 'thr') try {
try { WechatService::ThinkServiceConfig()->setApiNotifyUri($this->thrNotify);
WechatService::ThinkServiceConfig()->setApiNotifyUri($this->thrNotify); } catch (\Exception $exception) {
} catch (\Exception $exception) { $this->error($exception->getMessage());
$this->error($exception->getMessage());
}
} }
sysoplog('微信授权配置', '修改微信授权配置成功'); sysoplog('微信授权配置', '修改微信授权配置成功');
$location = url('wechat/config/options')->build() . '?uniqid=' . uniqid(); $this->success('微信授权修改成功!', admuri('', ['uniqid' => uniqid()]));
$this->success('微信授权修改成功!', sysuri('admin/index/index') . "#{$location}");
} }
} }
@ -85,6 +87,35 @@ class Config extends Controller
$this->fetch(); $this->fetch();
} }
/**
* 微信第三方平台接口配置
* @auth true
* @return void
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function options_jsonrpc()
{
if ($this->request->isGet()) {
$auth = sysconf('wechat.service_authurl|raw') ?: "https://open.cuci.cc/service/api.push/auth?source=SOURCE";
$jsonRpc = sysconf('wechat.service_jsonrpc|raw') ?: 'https://open.cuci.cc/service/api.client/jsonrpc?not_init_session=1&token=TOKEN';
Builder::mk()
->addTextInput('auth_url', '微信绑定授权跳转入口', 'Getway', true, '进入微信绑定授权时会跳转到这个页面,由微信管的理员扫二维码进行授权。', '^https://.*?jsonrpc.*?source=SOURCE.*?')
->addTextInput('json_rpc', '第三方服务平台 JsonRpc 接口', 'JsonRpc', true, '由应用插件 ThinkPlugsWechatService 服务提供的第三方平台 JSON-RPC 接口地址。', '^https://.*?jsonrpc.*?token=TOKEN.*?')
->addSubmitButton('保存参数')->addCancelButton()
->fetch(['vo' => ['auth_url' => $auth, 'json_rpc' => $jsonRpc]]);
} else {
$data = $this->_vali([
'auth_url.rquire' => '授权跳转不能为空!',
'json_rpc.require' => '接口地址不能为空!'
]);
sysconf('wechat.service_authurl', $data['auth_url']);
sysconf('wechat.service_jsonrpc', urldecode($data['json_rpc']));
$this->success('接口地址保存成功!');
}
}
/** /**
* 微信支付配置 * 微信支付配置
* @auth true * @auth true

View File

@ -115,8 +115,8 @@ class WechatService extends Service
$data['sign'] = md5("{$data['class']}#{$appid}#{$appkey}#{$data['time']}#{$data['nostr']}"); $data['sign'] = md5("{$data['class']}#{$appid}#{$appkey}#{$data['time']}#{$data['nostr']}");
// 创建远程连接,默认使用 JSON-RPC 方式调用接口 // 创建远程连接,默认使用 JSON-RPC 方式调用接口
$token = enbase64url(json_encode($data, JSON_UNESCAPED_UNICODE)); $token = enbase64url(json_encode($data, JSON_UNESCAPED_UNICODE));
$jsonrpc = sysconf('wechat.service_jsonrpc') ?: 'https://open.cuci.cc/service/api.client/jsonrpc?not_init_session=1&token=TOKEN'; $jsonrpc = sysconf('wechat.service_jsonrpc|raw') ?: 'https://open.cuci.cc/service/api.client/jsonrpc?not_init_session=1&token=TOKEN';
return new JsonRpcClient(str_replace('=TOKEN', "={$token}", $jsonrpc)); return new JsonRpcClient(str_replace('token=TOKEN', "token={$token}", $jsonrpc));
} }
} }

View File

@ -32,14 +32,14 @@
<div class='mobile-body' data-iframe-box></div> <div class='mobile-body' data-iframe-box></div>
</div> </div>
<div class="keys-container inline-block absolute margin-left-10 margin-right-15"> <div class="keys-container inline-block absolute margin-left-10 margin-right-15">
<form action="{:sysuri()}" method="post" data-auto="true" data-table-id="AutoTable" class="layui-form layui-card"> <form action="{:request()->url()}" method="post" data-auto="true" data-table-id="AutoTable" class="layui-form layui-card">
<div class="layui-card relative shadow-none"> <div class="layui-card relative shadow-none">
<div class="layui-card-header layui-bg-gray text-center">编辑回复规则</div> <div class="layui-card-header layui-bg-gray text-center">编辑回复规则</div>
<div class="layui-card-body"> <div class="layui-card-body">
<div class="layui-form-item margin-top-10"> <div class="layui-form-item margin-top-10">
<label class="layui-form-label">延迟时间</label> <label class="layui-form-label">延迟时间</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input required readonly placeholder='请输入延迟时间' maxlength='20' id="timeInput" name='time' class="layui-input" value='{$vo.time|default="00小时00分00秒"}'> <input required readonly placeholder='请输入延迟时间' vali-name="延迟时间" maxlength='20' id="timeInput" name='time' class="layui-input" value='{$vo.time|default="00小时00分00秒"}'>
<script>layui.laydate.render({elem: '#timeInput', type: "time", format: 'HH小时mm分ss秒', btns: ['confirm']});</script> <script>layui.laydate.render({elem: '#timeInput', type: "time", format: 'HH小时mm分ss秒', btns: ['confirm']});</script>
</div> </div>
</div> </div>
@ -76,7 +76,7 @@
<div class="layui-form-item" data-keys-type='text'> <div class="layui-form-item" data-keys-type='text'>
<label class="layui-form-label">回复文字</label> <label class="layui-form-label">回复文字</label>
<div class="layui-input-block"> <div class="layui-input-block">
<textarea name="content" required placeholder="请输入回复文字" maxlength="10000" class="layui-textarea">{$vo.content|raw|default='说点什么吧'}</textarea> <textarea name="content" required vali-name="回复文字" placeholder="请输入回复文字" maxlength="10000" class="layui-textarea">{$vo.content|raw|default='说点什么吧'}</textarea>
</div> </div>
</div> </div>
@ -91,7 +91,7 @@
<div class="layui-form-item" data-keys-type='image'> <div class="layui-form-item" data-keys-type='image'>
<label class="layui-form-label label-required">图片地址</label> <label class="layui-form-label label-required">图片地址</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input class="layui-input padding-right-30" onchange="$(this).nextAll('img').attr('src', this.value)" value="{$vo.image_url|default=$defaultImage}" name="image_url" required placeholder="请上传图片或输入图片地址"> <input class="layui-input padding-right-30" onchange="$(this).nextAll('img').attr('src', this.value)" value="{$vo.image_url|default=$defaultImage}" name="image_url" required vali-name="图片链接" placeholder="请上传图片或输入图片地址">
<a data-file="btn" data-type="bmp,png,jpeg,jpg,gif" data-field="image_url" class="input-right-icon"><i class="layui-icon layui-icon-upload"></i></a> <a data-file="btn" data-type="bmp,png,jpeg,jpg,gif" data-field="image_url" class="input-right-icon"><i class="layui-icon layui-icon-upload"></i></a>
<p class="help-block">文件最大2Mb支持bmp/png/jpeg/jpg/gif格式</p> <p class="help-block">文件最大2Mb支持bmp/png/jpeg/jpg/gif格式</p>
<img data-tips-image src='{$vo.image_url|default=$defaultImage}' alt="img"> <img data-tips-image src='{$vo.image_url|default=$defaultImage}' alt="img">
@ -101,7 +101,7 @@
<div class="layui-form-item" data-keys-type='voice'> <div class="layui-form-item" data-keys-type='voice'>
<label class="layui-form-label">上传语音</label> <label class="layui-form-label">上传语音</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input class='layui-input padding-right-30' value="{$vo.voice_url|default=''}" name="voice_url" required title="请上传语音文件或输入语音地址"> <input class='layui-input padding-right-30' value="{$vo.voice_url|default=''}" name="voice_url" required vali-name="语音链接" placeholder="请上传语音文件或输入语音地址">
<a data-file="btn" data-type="mp3,wma,wav,amr" data-field="voice_url" class="input-right-icon"><i class="layui-icon layui-icon-upload"></i></a> <a data-file="btn" data-type="mp3,wma,wav,amr" data-field="voice_url" class="input-right-icon"><i class="layui-icon layui-icon-upload"></i></a>
<p class="help-block">文件最大2Mb播放长度不超过60smp3/wma/wav/amr格式</p> <p class="help-block">文件最大2Mb播放长度不超过60smp3/wma/wav/amr格式</p>
</div> </div>
@ -110,14 +110,14 @@
<div class="layui-form-item" data-keys-type='music'> <div class="layui-form-item" data-keys-type='music'>
<label class="layui-form-label">音乐标题</label> <label class="layui-form-label">音乐标题</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input class='layui-input' value="{$vo.music_title|default='音乐标题'}" name="music_title" required title="请输入音乐标题"> <input class='layui-input' value="{$vo.music_title|default='音乐标题'}" name="music_title" required vali-name="音乐标题">
</div> </div>
</div> </div>
<div class="layui-form-item" data-keys-type='music'> <div class="layui-form-item" data-keys-type='music'>
<label class="layui-form-label label-required">上传音乐</label> <label class="layui-form-label label-required">上传音乐</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input class='layui-input padding-right-30' value="{$vo.music_url|default=''}" name="music_url" required title="请上传音乐文件或输入音乐地址"> <input class='layui-input padding-right-30' value="{$vo.music_url|default=''}" name="music_url" required vali-name="音乐链接" placeholder="请上传音乐文件或输入音乐地址">
<a data-file="btn" data-type="mp3,wma,wav,amr" data-field="music_url" class="input-right-icon"><i class="layui-icon layui-icon-upload"></i></a> <a data-file="btn" data-type="mp3,wma,wav,amr" data-field="music_url" class="input-right-icon"><i class="layui-icon layui-icon-upload"></i></a>
</div> </div>
</div> </div>
@ -132,7 +132,7 @@
<div class="layui-form-item" data-keys-type='music'> <div class="layui-form-item" data-keys-type='music'>
<label class="layui-form-label">音乐图片</label> <label class="layui-form-label">音乐图片</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input class="layui-input padding-right-30" value="{$vo.music_image|default=$defaultImage}" name="music_image" required title="请上传音乐图片或输入音乐图片地址"> <input class="layui-input padding-right-30" value="{$vo.music_image|default=$defaultImage}" name="music_image" required vali-name="音乐图片" placeholder="请上传音乐图片或输入音乐图片地址">
<a data-file="btn" data-type="jpg,png" data-field="music_image" class="input-right-icon"><i class="layui-icon layui-icon-upload"></i></a> <a data-file="btn" data-type="jpg,png" data-field="music_image" class="input-right-icon"><i class="layui-icon layui-icon-upload"></i></a>
<p class="help-block">文件最大64KB只支持JPG格式</p> <p class="help-block">文件最大64KB只支持JPG格式</p>
</div> </div>
@ -148,7 +148,7 @@
<div class="layui-form-item" data-keys-type='video'> <div class="layui-form-item" data-keys-type='video'>
<label class="layui-form-label">上传视频</label> <label class="layui-form-label">上传视频</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input class='layui-input padding-right-30' value="{$vo.video_url|default=''}" name="video_url" required title="请上传视频或输入音乐视频地址"> <input class='layui-input padding-right-30' value="{$vo.video_url|default=''}" name="video_url" required vali-name="视频链接" placeholder="请上传视频或输入视频地址">
<a data-file="btn" data-type="mp4" data-field="video_url" class="input-right-icon"><i class="layui-icon layui-icon-upload"></i></a> <a data-file="btn" data-type="mp4" data-field="video_url" class="input-right-icon"><i class="layui-icon layui-icon-upload"></i></a>
<p class="help-block">文件最大10MB只支持MP4格式</p> <p class="help-block">文件最大10MB只支持MP4格式</p>
</div> </div>

View File

@ -1,6 +1,9 @@
{extend name="main"} {extend name="main"}
{block name="button"} {block name="button"}
<!--{if auth('options_jsonrpc')}-->
<button data-modal="{:url('options_jsonrpc')}" data-width="600px" data-title="开放平台接口配置" class='layui-btn layui-btn-sm layui-btn-primary'>开放平台接口</button>
<!--{/if}-->
<!--{if auth("options_test")}--> <!--{if auth("options_test")}-->
<button data-modal="{:url('options_test')}" data-width="600px" data-title="微信授权测试( 扫码 " class='layui-btn layui-btn-sm layui-btn-primary'>微信授权测试</button> <button data-modal="{:url('options_test')}" data-width="600px" data-title="微信授权测试( 扫码 " class='layui-btn layui-btn-sm layui-btn-primary'>微信授权测试</button>
<!--{/if}--> <!--{/if}-->
@ -12,7 +15,7 @@
{foreach ['api'=>'微信公众平台直接模式','thr'=>'微信开放平台授权模式'] as $k=>$v} {foreach ['api'=>'微信公众平台直接模式','thr'=>'微信开放平台授权模式'] as $k=>$v}
<input type="radio" data-wechat-type="{$k}" name="wechat.type" value="{$k}" title="{$v}" lay-filter="wechat_type"> <input type="radio" data-wechat-type="{$k}" name="wechat.type" value="{$k}" title="{$v}" lay-filter="wechat_type">
{/foreach} {/foreach}
<p class="help-block">请选择微信对接方式,其中微信开放平台授权模式是需要微信开放平台支持,还需要搭建微信授权服务</p> <p class="help-block">请选择微信对接方式,其中微信开放平台授权模式需要微信开放平台支持,还需要搭建第三方服务平台托管系统</p>
</div> </div>
</div> </div>
<div class="think-box-shadow margin-top-15"> <div class="think-box-shadow margin-top-15">

View File

@ -1,4 +1,4 @@
<form action="{:sysuri()}" method="post" data-auto="true" class="layui-form layui-card shadow-none"> <form action="{:request()->url()}" method="post" data-auto="true" class="layui-form layui-card shadow-none">
<div class="layui-card-header border-0"> <div class="layui-card-header border-0">
<div class="layui-bg-gray padding-left-20 padding-right-20 border-radius-5 layui-elip"> <div class="layui-bg-gray padding-left-20 padding-right-20 border-radius-5 layui-elip">
@ -11,7 +11,7 @@
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label"><b>Token</b><br><span class="nowrap color-desc">接口认证令牌</span></label> <label class="layui-form-label"><b>Token</b><br><span class="nowrap color-desc">接口认证令牌</span></label>
<div class="layui-input-block"> <div class="layui-input-block">
<input name="wechat.token" required placeholder="请输入消息推送对接认证Token必填" value="{:sysconf('wechat.token')}" class="layui-input"> <input name="wechat.token" required vali-name="认证TOKEN" placeholder="请输入消息推送对接认证Token必填" value="{:sysconf('wechat.token')}" class="layui-input">
<p class="help-block">公众号平台与系统对接认证Token请优先填写此参数并保存然后再在微信公众号平台操作对接。</p> <p class="help-block">公众号平台与系统对接认证Token请优先填写此参数并保存然后再在微信公众号平台操作对接。</p>
</div> </div>
</div> </div>
@ -19,7 +19,7 @@
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label"><b>AppId</b><br><span class="nowrap color-desc">公众号 APPID</span></label> <label class="layui-form-label"><b>AppId</b><br><span class="nowrap color-desc">公众号 APPID</span></label>
<div class="layui-input-block"> <div class="layui-input-block">
<input name="wechat.appid" placeholder="请输入以wx开头的18位公众号APPID必填" pattern="^wx[0-9a-z]{16}$" maxlength="18" required="required" value="{:sysconf('wechat.appid')}" class="layui-input"> <input name="wechat.appid" vali-name="微信APPID" placeholder="请输入以wx开头的18位公众号APPID必填" pattern="^wx[0-9a-z]{16}$" maxlength="18" required="required" value="{:sysconf('wechat.appid')}" class="layui-input">
<p class="help-block">公众号APPID是所有接口必要参数可以在公众号平台 [ 开发 > 基本配置 ] 页面获取。</p> <p class="help-block">公众号APPID是所有接口必要参数可以在公众号平台 [ 开发 > 基本配置 ] 页面获取。</p>
</div> </div>
</div> </div>
@ -27,7 +27,7 @@
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label"><b>AppSecret</b><br><span class="nowrap color-desc">公众号 Secret</span></label> <label class="layui-form-label"><b>AppSecret</b><br><span class="nowrap color-desc">公众号 Secret</span></label>
<div class="layui-input-block"> <div class="layui-input-block">
<input name="wechat.appsecret" required placeholder="请输入32位公众号接口密钥AppSecret必填" value="{:sysconf('wechat.appsecret')}" maxlength="32" pattern="^[0-9a-z]{32}$" class="layui-input"> <input name="wechat.appsecret" required vali-name="接口密钥" placeholder="请输入32位公众号接口密钥AppSecret必填" value="{:sysconf('wechat.appsecret')}" maxlength="32" pattern="^[0-9a-z]{32}$" class="layui-input">
<p class="help-block">公众号应用密钥是所有接口必要参数,可以在公众号平台 [ 开发 > 基本配置 ] 页面授权后获取。</p> <p class="help-block">公众号应用密钥是所有接口必要参数,可以在公众号平台 [ 开发 > 基本配置 ] 页面授权后获取。</p>
</div> </div>
</div> </div>
@ -35,7 +35,7 @@
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label"><b>AesKey</b><br><span class="nowrap color-desc">消息加密密钥</span></label> <label class="layui-form-label"><b>AesKey</b><br><span class="nowrap color-desc">消息加密密钥</span></label>
<div class="layui-input-block"> <div class="layui-input-block">
<input name="wechat.encodingaeskey" placeholder="请输入43位公众号消息推送加密密钥可选" value="{:sysconf('wechat.encodingaeskey')}" maxlength="43" pattern="^.{43}$" class="layui-input"> <input name="wechat.encodingaeskey" vali-name="消息密钥" placeholder="请输入43位公众号消息推送加密密钥可选" value="{:sysconf('wechat.encodingaeskey')}" maxlength="43" pattern="^.{43}$" class="layui-input">
<p class="help-block">若开启了消息加密时必需填写,消息加密密钥必需填写并保持与公众号平台一致。</p> <p class="help-block">若开启了消息加密时必需填写,消息加密密钥必需填写并保持与公众号平台一致。</p>
</div> </div>
</div> </div>

View File

@ -1,8 +1,8 @@
<form action="{:sysuri()}" method="post" data-auto="true" class="layui-form layui-card shadow-none"> <form action="{:request()->url()}" method="post" data-auto="true" class="layui-form layui-card shadow-none">
<div class="layui-card-header border-0"> <div class="layui-card-header border-0">
<div class="layui-bg-gray padding-left-20 padding-right-20 border-radius-5 layui-elip"> <div class="layui-bg-gray padding-left-20 padding-right-20 border-radius-5 layui-elip">
使用微信开放平台授权模式时,需要使用楚才开放平台的 <span>微信授权</span> 服务,接口需要使用 <span>Yar</span> <span>JsonRpc</span> 通信 使用微信开放平台授权模式时,微信将授权给第三方服务平台托管系统,消息数据使用 <span>JsonRpc</span> 通信协议转发
</div> </div>
</div> </div>
@ -38,7 +38,7 @@
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label"><b>AppId</b><br><span class="nowrap color-desc">公众号 AppId</span></label> <label class="layui-form-label"><b>AppId</b><br><span class="nowrap color-desc">公众号 AppId</span></label>
<div class="layui-input-block"> <div class="layui-input-block">
<input name="wechat.thr_appid" placeholder="请输入以wx开头的18位公众号AppId必填" pattern="^wx[0-9a-z]{16}$" maxlength="18" required value="{:sysconf('wechat.thr_appid')}" class="layui-input"> <input name="wechat.thr_appid" vali-name="微信APPID" placeholder="请输入以wx开头的18位公众号AppId必填" pattern="^wx[0-9a-z]{16}$" maxlength="18" required value="{:sysconf('wechat.thr_appid')}" class="layui-input">
<p class="help-block">众号 appid 通过微信第三方授权自动获取. 若没有值请进行微信第三方授权。</p> <p class="help-block">众号 appid 通过微信第三方授权自动获取. 若没有值请进行微信第三方授权。</p>
</div> </div>
</div> </div>
@ -47,7 +47,7 @@
<label class="layui-form-label"><b>AppKey</b><br><span class="nowrap color-desc">服务接口密钥</span></label> <label class="layui-form-label"><b>AppKey</b><br><span class="nowrap color-desc">服务接口密钥</span></label>
<div class="layui-input-block"> <div class="layui-input-block">
<label class="relative block"> <label class="relative block">
<input name="wechat.thr_appkey" required placeholder="请输入32位第三方平台接口密钥AppKey必填" value="{:sysconf('wechat.thr_appkey')}" maxlength="32" pattern="^[0-9a-z]{32}$" class="layui-input"> <input name="wechat.thr_appkey" vali-name="接口密钥" required placeholder="请输入32位第三方平台接口密钥AppKey必填" value="{:sysconf('wechat.thr_appkey')}" maxlength="32" pattern="^[0-9a-z]{32}$" class="layui-input">
<p class="help-block">公众号服务平台接口密钥, 通过微信第三方授权自动获取, 若没有值请进行微信第三方授权。</p> <p class="help-block">公众号服务平台接口密钥, 通过微信第三方授权自动获取, 若没有值请进行微信第三方授权。</p>
</label> </label>
</div> </div>

View File

@ -9,10 +9,10 @@
{block name="content"} {block name="content"}
<div class="think-box-shadow"> <div class="think-box-shadow">
<div class="layui-anim layui-anim-fadein padding-top-20" style="width:850px"> <div class="layui-anim layui-anim-fadein padding-top-20" style="width:850px">
<form action="{:url('payment_save')}" method="post" data-auto="true" class='layui-form layui-card shadow-none' lay-filter="payment"> <form action="{:url('payment_save')}" method="post" data-auto="true" class='layui-form layui-card shadow-none' lay-filter="payment">
<div class="layui-card-header border-0"> <div class="layui-card-header border-0">
<div class="layui-bg-gray padding-col-20 border-radius-5"> <div class="layui-bg-gray padding-col-20 border-radius-5 padding-left-20">
微信商户参数配置,此处交易的商户号需要与微信公众号对接的公众号 APPID 匹配。 微信商户参数配置,此处交易的商户号需要与微信公众号对接的公众号 APPID 匹配。
</div> </div>
</div> </div>
@ -21,7 +21,7 @@
<div class="layui-form-item margin-top-15"> <div class="layui-form-item margin-top-15">
<label class="layui-form-label"><b>MCH_ID</b><br><span class="nowrap color-desc">微信商户账号</span></label> <label class="layui-form-label"><b>MCH_ID</b><br><span class="nowrap color-desc">微信商户账号</span></label>
<div class="layui-input-block"> <div class="layui-input-block">
<input name="wechat.mch_id" required placeholder="请输入微信商户账号(必填)" value="{:sysconf('wechat.mch_id')}" class="layui-input"> <input name="wechat.mch_id" required vali-name="微信商户号" placeholder="请输入微信商户账号(必填)" value="{:sysconf('wechat.mch_id')}" class="layui-input">
<p class="help-block">微信商户账号需要在微信商户平台获取MCH_ID APPID 匹配</p> <p class="help-block">微信商户账号需要在微信商户平台获取MCH_ID APPID 匹配</p>
</div> </div>
</div> </div>
@ -29,7 +29,7 @@
<div class="layui-form-item"> <div class="layui-form-item">
<label class="layui-form-label"><b>MCH_KEY</b><br><span class="nowrap color-desc">微信商户密钥</span></label> <label class="layui-form-label"><b>MCH_KEY</b><br><span class="nowrap color-desc">微信商户密钥</span></label>
<div class="layui-input-block"> <div class="layui-input-block">
<input name="wechat.mch_key" placeholder="请输入微信商户密钥(必填)" maxlength="32" pattern=".{32}" required value="{:sysconf('wechat.mch_key')}" class="layui-input"> <input name="wechat.mch_key" vali-name="微信商户密钥" placeholder="请输入微信商户密钥(必填)" maxlength="32" pattern=".{32}" required value="{:sysconf('wechat.mch_key')}" class="layui-input">
<p class="help-block">微信商户密钥,需要在微信商户平台操作设置操作密码并获取商户接口密钥</p> <p class="help-block">微信商户密钥,需要在微信商户平台操作设置操作密码并获取商户接口密钥</p>
</div> </div>
</div> </div>

View File

@ -18,7 +18,7 @@
{block name="content"} {block name="content"}
<div class="think-box-shadow"> <div class="think-box-shadow">
{include file='fans/index_search'} {include file='fans/index_search'}
<table id="UserData" data-url="{:sysuri()}" data-target-search="form.form-search"></table> <table id="UserData" data-url="{:request()->url()}" data-target-search="form.form-search"></table>
</div> </div>
{/block} {/block}

View File

@ -30,7 +30,7 @@
<div class='mobile-body' data-iframe-box></div> <div class='mobile-body' data-iframe-box></div>
</div> </div>
<div class="keys-container inline-block absolute margin-left-10 margin-right-15"> <div class="keys-container inline-block absolute margin-left-10 margin-right-15">
<form action="{:sysuri()}" method="post" data-auto="true" class="layui-form layui-card"> <form action="{:request()->url()}" method="post" data-auto="true" class="layui-form layui-card">
<div class="layui-card relative shadow-none"> <div class="layui-card relative shadow-none">
<div class="layui-card-header layui-bg-gray text-center">编辑关键字</div> <div class="layui-card-header layui-bg-gray text-center">编辑关键字</div>
<div class="layui-card-body"> <div class="layui-card-body">
@ -38,7 +38,7 @@
<div class="layui-form-item margin-top-10"> <div class="layui-form-item margin-top-10">
<label class="layui-form-label">&ensp;&ensp;</label> <label class="layui-form-label">&ensp;&ensp;</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input required placeholder='请输入关键字' maxlength='20' name='keys' class="layui-input" value='{$vo.keys|default=""}'> <input required vali-name="关键字" placeholder='请输入关键字' maxlength='20' name='keys' class="layui-input" value='{$vo.keys|default=""}'>
</div> </div>
</div> </div>
<!--{else}--> <!--{else}-->
@ -77,7 +77,7 @@
<div class="layui-form-item" data-keys-type='text'> <div class="layui-form-item" data-keys-type='text'>
<label class="layui-form-label">回复文字</label> <label class="layui-form-label">回复文字</label>
<div class="layui-input-block"> <div class="layui-input-block">
<textarea name="content" required placeholder="请输入回复文字" maxlength="10000" class="layui-textarea">{$vo.content|raw|default='说点什么吧'}</textarea> <textarea name="content" required vali-name="回复文字" placeholder="请输入回复文字" maxlength="10000" class="layui-textarea">{$vo.content|raw|default='说点什么吧'}</textarea>
</div> </div>
</div> </div>
@ -92,7 +92,7 @@
<div class="layui-form-item" data-keys-type='image'> <div class="layui-form-item" data-keys-type='image'>
<label class="layui-form-label label-required">图片地址</label> <label class="layui-form-label label-required">图片地址</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input class="layui-input padding-right-30" onchange="$(this).nextAll('img').attr('src', this.value)" value="{$vo.image_url|default=$defaultImage}" name="image_url" required placeholder="请上传图片或输入图片URL地址  "> <input class="layui-input padding-right-30" onchange="$(this).nextAll('img').attr('src', this.value)" value="{$vo.image_url|default=$defaultImage}" name="image_url" required vali-name="图片链接" placeholder="请上传图片或输入图片URL地址  ">
<a data-file="btn" data-type="bmp,png,jpeg,jpg,gif" data-field="image_url" class="input-right-icon"><i class="layui-icon layui-icon-upload"></i></a> <a data-file="btn" data-type="bmp,png,jpeg,jpg,gif" data-field="image_url" class="input-right-icon"><i class="layui-icon layui-icon-upload"></i></a>
<p class="help-block">文件最大2Mb支持bmp/png/jpeg/jpg/gif格式</p> <p class="help-block">文件最大2Mb支持bmp/png/jpeg/jpg/gif格式</p>
<img data-tips-image src='{$vo.image_url|default=$defaultImage}' alt="img"> <img data-tips-image src='{$vo.image_url|default=$defaultImage}' alt="img">
@ -102,7 +102,7 @@
<div class="layui-form-item" data-keys-type='voice'> <div class="layui-form-item" data-keys-type='voice'>
<label class="layui-form-label">上传语音</label> <label class="layui-form-label">上传语音</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input class='layui-input padding-right-30' value="{$vo.voice_url|default=''}" name="voice_url" required title="请上传语音文件或输入语音URL地址  "> <input class='layui-input padding-right-30' value="{$vo.voice_url|default=''}" name="voice_url" required vali-name="语音链接" placeholder="请上传语音文件或输入语音URL地址  ">
<a data-file="btn" data-type="mp3,wma,wav,amr" data-field="voice_url" class="input-right-icon"><i class="layui-icon layui-icon-upload"></i></a> <a data-file="btn" data-type="mp3,wma,wav,amr" data-field="voice_url" class="input-right-icon"><i class="layui-icon layui-icon-upload"></i></a>
<p class="help-block">文件最大2Mb播放长度不超过60smp3/wma/wav/amr格式</p> <p class="help-block">文件最大2Mb播放长度不超过60smp3/wma/wav/amr格式</p>
</div> </div>
@ -111,14 +111,14 @@
<div class="layui-form-item" data-keys-type='music'> <div class="layui-form-item" data-keys-type='music'>
<label class="layui-form-label">音乐标题</label> <label class="layui-form-label">音乐标题</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input class='layui-input' value="{$vo.music_title|default='音乐标题'}" name="music_title" required title="请输入音乐标题"> <input class='layui-input' value="{$vo.music_title|default='音乐标题'}" name="music_title" required vali-name="音乐标题" placeholder="请输入音乐标题">
</div> </div>
</div> </div>
<div class="layui-form-item" data-keys-type='music'> <div class="layui-form-item" data-keys-type='music'>
<label class="layui-form-label label-required">上传音乐</label> <label class="layui-form-label label-required">上传音乐</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input class='layui-input padding-right-30' value="{$vo.music_url|default=''}" name="music_url" required title="请上传音乐文件或输入音乐URL地址  "> <input class='layui-input padding-right-30' value="{$vo.music_url|default=''}" name="music_url" required vali-name="音乐链接" placeholder="请上传音乐文件或输入音乐URL地址  ">
<a data-file="btn" data-type="mp3,wma,wav,amr" data-field="music_url" class="input-right-icon"><i class="layui-icon layui-icon-upload"></i></a> <a data-file="btn" data-type="mp3,wma,wav,amr" data-field="music_url" class="input-right-icon"><i class="layui-icon layui-icon-upload"></i></a>
</div> </div>
</div> </div>
@ -133,7 +133,7 @@
<div class="layui-form-item" data-keys-type='music'> <div class="layui-form-item" data-keys-type='music'>
<label class="layui-form-label">音乐图片</label> <label class="layui-form-label">音乐图片</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input class="layui-input padding-right-30" value="{$vo.music_image|default=$defaultImage}" name="music_image" required title="请上传音乐图片或输入音乐图片URL地址  "> <input class="layui-input padding-right-30" value="{$vo.music_image|default=$defaultImage}" name="music_image" required vali-name="图片链接" placeholder="请上传音乐图片或输入音乐图片URL地址  ">
<a data-file="btn" data-type="jpg,png" data-field="music_image" class="input-right-icon"><i class="layui-icon layui-icon-upload"></i></a> <a data-file="btn" data-type="jpg,png" data-field="music_image" class="input-right-icon"><i class="layui-icon layui-icon-upload"></i></a>
<p class="help-block">文件最大64KB只支持JPG格式</p> <p class="help-block">文件最大64KB只支持JPG格式</p>
</div> </div>
@ -142,14 +142,14 @@
<div class="layui-form-item" data-keys-type='video'> <div class="layui-form-item" data-keys-type='video'>
<label class="layui-form-label">视频标题</label> <label class="layui-form-label">视频标题</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input class='layui-input' value="{$vo.video_title|default='视频标题'}" name="video_title" required placeholder="请输入视频标题"> <input class='layui-input' value="{$vo.video_title|default='视频标题'}" name="video_title" required vali-name="视频标题" placeholder="请输入视频标题">
</div> </div>
</div> </div>
<div class="layui-form-item" data-keys-type='video'> <div class="layui-form-item" data-keys-type='video'>
<label class="layui-form-label">上传视频</label> <label class="layui-form-label">上传视频</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input class='layui-input padding-right-30' value="{$vo.video_url|default=''}" name="video_url" required title="请上传视频或输入音乐视频URL地址  "> <input class='layui-input padding-right-30' value="{$vo.video_url|default=''}" name="video_url" required vali-name="视频链接" placeholder="请上传视频或输入视频URL地址  ">
<a data-file="btn" data-type="mp4" data-field="video_url" class="input-right-icon"><i class="layui-icon layui-icon-upload"></i></a> <a data-file="btn" data-type="mp4" data-field="video_url" class="input-right-icon"><i class="layui-icon layui-icon-upload"></i></a>
<p class="help-block">文件最大10MB只支持MP4格式</p> <p class="help-block">文件最大10MB只支持MP4格式</p>
</div> </div>

View File

@ -38,7 +38,7 @@
</ul> </ul>
<div class="layui-tab-content"> <div class="layui-tab-content">
{include file='keys/index_search'} {include file='keys/index_search'}
<table id="RuleTable" data-url="{:sysuri()}" data-target-search="form.form-search"></table> <table id="RuleTable" data-url="{:request()->url()}" data-target-search="form.form-search"></table>
</div> </div>
</div> </div>
{/block} {/block}
@ -102,7 +102,7 @@
<!-- 列表排序权重模板 --> <!-- 列表排序权重模板 -->
<script type="text/html" id="SortInputTpl"> <script type="text/html" id="SortInputTpl">
<input type="number" min="0" data-blur-number="0" data-action-blur="{:sysuri()}" data-value="id#{{d.id}};action#sort;sort#{value}" data-loading="false" value="{{d.sort}}" class="layui-input text-center"> <input type="number" min="0" data-blur-number="0" data-action-blur="{:request()->url()}" data-value="id#{{d.id}};action#sort;sort#{value}" data-loading="false" value="{{d.sort}}" class="layui-input text-center">
</script> </script>
<!-- 状态切换模板 --> <!-- 状态切换模板 -->

View File

@ -29,15 +29,20 @@ require.config({
baseUrl: baseRoot, waitSeconds: 60, baseUrl: baseRoot, waitSeconds: 60,
map: {'*': {css: baseRoot + 'plugs/require/css.js'}}, map: {'*': {css: baseRoot + 'plugs/require/css.js'}},
paths: { paths: {
// ---------- 自定义 ----------
'excel': ['plugs/admin/excel'],
'queue': ['plugs/admin/queue'],
'upload': [tapiRoot + '/api.upload/index?'],
'validate': ['plugs/admin/validate'],
'pcasunzips': ['plugs/jquery/pcasunzips'],
// ---------- 开源库 ----------
'vue': ['plugs/vue/vue.min'], 'vue': ['plugs/vue/vue.min'],
'md5': ['plugs/jquery/md5.min'], 'md5': ['plugs/jquery/md5.min'],
'json': ['plugs/jquery/json.min'], 'json': ['plugs/jquery/json.min'],
'xlsx': ['plugs/jquery/xlsx.min'], 'xlsx': ['plugs/jquery/xlsx.min'],
'jszip': ['plugs/jquery/jszip.min'], 'jszip': ['plugs/jquery/jszip.min'],
'excel': ['plugs/jquery/excel.xlsx'],
'marked': ['plugs/jquery/marked.min'], 'marked': ['plugs/jquery/marked.min'],
'base64': ['plugs/jquery/base64.min'], 'base64': ['plugs/jquery/base64.min'],
'upload': [tapiRoot + '/api.upload/index?'],
'notify': ['plugs/notify/notify.min'], 'notify': ['plugs/notify/notify.min'],
'angular': ['plugs/angular/angular.min'], 'angular': ['plugs/angular/angular.min'],
'cropper': ['plugs/cropper/cropper.min'], 'cropper': ['plugs/cropper/cropper.min'],
@ -46,7 +51,6 @@ require.config({
'ckeditor5': ['plugs/ckeditor5/ckeditor'], 'ckeditor5': ['plugs/ckeditor5/ckeditor'],
'filesaver': ['plugs/jquery/filesaver.min'], 'filesaver': ['plugs/jquery/filesaver.min'],
'websocket': ['plugs/socket/websocket'], 'websocket': ['plugs/socket/websocket'],
'pcasunzips': ['plugs/jquery/pcasunzips'],
'compressor': ['plugs/jquery/compressor.min'], 'compressor': ['plugs/jquery/compressor.min'],
'sortablejs': ['plugs/sortable/sortable.min'], 'sortablejs': ['plugs/sortable/sortable.min'],
'vue.sortable': ['plugs/sortable/vue.draggable.min'], 'vue.sortable': ['plugs/sortable/vue.draggable.min'],
@ -80,7 +84,9 @@ define('ckeditor', (function (type) {
return ckeditor; return ckeditor;
}); });
$(function () { /*! 注册 ThinkAdmin 组件 */
define('ThinkAdmin', function (require) {
window.$body = $('body'); window.$body = $('body');
/*! 注册单次事件 */ /*! 注册单次事件 */
@ -325,7 +331,7 @@ $(function () {
this.goto = function (url) { this.goto = function (url) {
if (typeof url !== 'string' || url.length < 1) return; if (typeof url !== 'string' || url.length < 1) return;
if (url.toLowerCase().indexOf('javascript:') === 0) { if (url.toLowerCase().indexOf('javascript:') === 0) {
return eval(url.split('javascript:', 2)[1]); return eval(url.split(':', 2)[1]);
} else { } else {
return location.href = url; return location.href = url;
} }
@ -416,7 +422,7 @@ $(function () {
}); });
}); });
/*! 监听窗口大小及HASH切换 */ /*! 监听窗口大小及HASH切换 */
$(window).on('resize', function () { return $(window).on('resize', function () {
(layui.data('AdminMenuType')['mini'] || $body.width() < 1000) ? layout.addClass(mclass) : layout.removeClass(mclass); (layui.data('AdminMenuType')['mini'] || $body.width() < 1000) ? layout.addClass(mclass) : layout.removeClass(mclass);
}).trigger('resize').on('hashchange', function () { }).trigger('resize').on('hashchange', function () {
if (/^#(https?:)?(\/\/|\\\\)/.test(location.hash)) return $.msg.tips('禁止访问外部链接!'); if (/^#(https?:)?(\/\/|\\\\)/.test(location.hash)) return $.msg.tips('禁止访问外部链接!');
@ -459,87 +465,7 @@ $(function () {
/*! 表单验证组件 */ /*! 表单验证组件 */
$.vali = function (form, callable) { $.vali = function (form, callable) {
return $(form).data('validate') || new Validate(); return $(form).data('validate') || new (require('validate'))(form, callable, onConfirm);
function Validate() {
var that = this;
/* 绑定表单元素 */
this.form = $(form);
/* 绑定元素事件, 筛选表单元素 */
this.evts = 'blur change';
this.tags = 'input,textarea';
/* 预设检测规则 */
this.patterns = {
phone: '^1[3-9][0-9]{9}$',
email: '^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$'
};
/*! 检测属性是否有定义 */
this.hasProp = function (ele, prop) {
var attrProp = ele.getAttribute(prop);
return typeof attrProp !== 'undefined' && attrProp !== null && attrProp !== false;
}, this.isRegex = function (ele) {
var real = $.trim($(ele).val());
var regexp = ele.getAttribute('pattern');
regexp = this.patterns[regexp] || regexp;
if (real === "" || !regexp) return true;
return new RegExp(regexp, 'i').test(real);
}, this.checkAllInput = function () {
var status = true;
return that.form.find(this.tags).each(function () {
if (that.checkInput(this) === false) return $(this).focus(), status = false;
}), status;
}, this.checkInput = function (input) {
if (this.hasProp(input, 'data-auto-none')) return true;
var type = (input.getAttribute('type') || '').replace(/\W+/, "").toLowerCase();
var ingores = ['file', 'reset', 'image', 'radio', 'checkbox', 'submit', 'hidden'];
if (ingores.length > 0) for (var i in ingores) if (type === ingores[i]) return true;
if (this.hasProp(input, 'required') && $.trim($(input).val()) === '') return this.remind(input);
return this.isRegex(input) ? (this.hideError(input), true) : this.remind(input);
}, this.remind = function (input) {
if (!$(input).is(':visible')) return true;
return this.showError(input, input.getAttribute('title') || input.getAttribute('placeholder') || '输入错误'), false;
}, this.showError = function (ele, tip) {
$(ele).addClass('validate-error');
this.insertError(ele).addClass('layui-anim-fadein').css({width: 'auto'}).html(tip);
}, this.hideError = function (ele) {
$(ele).removeClass('validate-error');
this.insertError(ele).removeClass('layui-anim-fadein').css({width: '30px'}).html('');
}, this.insertError = function (ele) {
if ($(ele).data('input-info')) return $(ele).data('input-info');
var $html = $('<span class="absolute block layui-anim text-center font-s12 notselect" style="color:#A44;z-index:2"></span>');
var $next = $(ele).nextAll('.input-right-icon'), right = ($next ? $next.width() + parseFloat($next.css('right') || '0') : 0) + 10;
var style = {top: $(ele).position().top + 'px', right: right + 'px', lineHeight: ele.nodeName === 'TEXTAREA' ? '32px' : $(ele).css('height')};
return $(ele).data('input-info', $html.css(style).insertAfter(ele)), $html;
};
/*! 表单元素验证 */
this.form.attr({onsubmit: 'return false', novalidate: 'novalidate', autocomplete: 'off'});
this.form.off(this.evts, this.tags).on(this.evts, this.tags, function () {
that.checkInput(this);
}).data('validate', this).bind('submit', function (event) {
event.button = that.form.find('button[type=submit],button:not([type=button])');
/* 检查所有表单元素是否通过H5的规则验证 */
if (that.checkAllInput() && typeof callable === 'function') {
if (typeof CKEDITOR === 'object' && typeof CKEDITOR.instances === 'object') {
for (var i in CKEDITOR.instances) CKEDITOR.instances[i].updateElement();
}
/* 触发表单提交后,锁定三秒不能再次提交表单 */
if (that.form.attr('submit-locked')) return false;
onConfirm(event.button.attr('data-confirm'), function () {
that.form.attr('submit-locked', 1);
event.button.addClass('submit-button-loading');
callable.call(form, that.form.formToJson(), []);
setTimeout(function () {
that.form.removeAttr('submit-locked');
event.button.removeClass('submit-button-loading');
}, 3000);
});
}
return event.preventDefault(), false;
}).find('[data-form-loaded]').map(function () {
$(this).html(this.dataset.formLoaded || this.innerHTML);
$(this).removeAttr('data-form-loaded').removeClass('layui-disabled');
});
}
}; };
/*! 自动监听表单 */ /*! 自动监听表单 */
@ -848,64 +774,8 @@ $(function () {
/*! 显示任务进度消息 */ /*! 显示任务进度消息 */
$.loadQueue = function (code, doScript, element) { $.loadQueue = function (code, doScript, element) {
var doAjax = true, doReload = false, template = '<div class="padding-30 padding-bottom-0" data-queue-load="{{d.code}}"><div class="layui-elip notselect nowrap" data-message-title><b class="color-desc">...</b></div><div class="margin-top-15 layui-progress layui-progress-big" lay-showPercent="yes"><div class="layui-progress-bar transition" lay-percent="0.00%"></div></div>' + '<div class="margin-top-15"><code class="layui-textarea layui-bg-black border-0" style="resize:none;overflow:hidden;height:190px"></code></div></div>'; require(['queue'], function (method) {
layer.open({ method(code, doScript, element);
type: 1, title: false, area: ['560px', '315px'], anim: 2, shadeClose: false, end: function () {
doAjax = doReload && doScript && $.layTable.reload(((element || {}).dataset || {}).tableId || true), false;
}, content: laytpl(template).render({code: code}), success: function ($elem) {
new function () {
var that = this;
this.$box = $elem.find('[data-queue-load=' + code + ']');
if (doAjax === false || this.$box.length < 1) return false;
this.$coder = this.$box.find('code'), this.$name = this.$box.find('[data-message-title]');
this.$percent = this.$box.find('.layui-progress div'), this.SetCache = function (code, index, value) {
var ckey = code + '_' + index, ctype = 'admin-queue-script';
return value !== undefined ? layui.data(ctype, {key: ckey, value: value}) : layui.data(ctype)[ckey] || 0;
}, this.SetState = function (status, message) {
if (message.indexOf('javascript:') === -1) if (status === 1) {
that.$name.html('<b class="color-text">' + message + '</b>').addClass('text-center');
that.$percent.addClass('layui-bg-blue').removeClass('layui-bg-green layui-bg-red');
} else if (status === 2) {
if (message.indexOf('>>>') > -1) {
that.$name.html('<b class="color-blue">' + message + '</b>').addClass('text-center');
} else {
that.$name.html('<b class="color-blue">正在处理:</b>' + message).removeClass('text-center');
}
that.$percent.addClass('layui-bg-blue').removeClass('layui-bg-green layui-bg-red');
} else if (status === 3) {
doReload = true;
that.$name.html('<b class="color-green">' + message + '</b>').addClass('text-center');
that.$percent.addClass('layui-bg-green').removeClass('layui-bg-blue layui-bg-red');
} else if (status === 4) {
that.$name.html('<b class="color-red">' + message + '</b>').addClass('text-center');
that.$percent.addClass('layui-bg-red').removeClass('layui-bg-blue layui-bg-green');
}
}, (this.LoadProgress = function () {
if (doAjax === false || that.$box.length < 1) return false;
$.form.load(tapiRoot + '/api.queue/progress', {code: code}, 'post', function (ret) {
if (ret.code) {
var lines = [];
for (var idx in ret.data.history) {
var line = ret.data.history[idx], percent = '[ ' + line.progress + '% ] ';
if (line.message.indexOf('javascript:') === -1) {
lines.push(line.message.indexOf('>>>') > -1 ? line.message : percent + line.message);
} else if (!that.SetCache(code, idx) && doScript !== false) {
that.SetCache(code, idx, 1), $.form.goto(line.message);
}
}
if (ret.data.status > 0) {
that.SetState(parseInt(ret.data.status), ret.data.message);
that.$percent.attr('lay-percent', (parseFloat(ret.data.progress || '0.00').toFixed(2)) + '%'), layui.element.render();
that.$coder.html('<p class="layui-elip">' + lines.join('</p><p class="layui-elip">') + '</p>').animate({scrollTop: that.$coder[0].scrollHeight + 'px'}, 200);
return parseInt(ret.data.status) === 3 || parseInt(ret.data.status) === 4 || setTimeout(that.LoadProgress, Math.floor(Math.random() * 200)), false;
} else {
return setTimeout(that.LoadProgress, Math.floor(Math.random() * 500) + 200), false;
}
}
}, false);
})();
};
}
}); });
}; };
@ -1122,6 +992,9 @@ $(function () {
event.target.src = baseRoot + 'theme/img/404_icon.png'; event.target.src = baseRoot + 'theme/img/404_icon.png';
}, true); }, true);
/*! 系统菜单表单页面初始化 */ });
$.menu.listen(), $.form.reInit($body);
/*! 系统菜单表单页面初始化 */
require(['ThinkAdmin'], function () {
$.menu.listen() && $.form.reInit($body);
}); });

View File

@ -12,7 +12,7 @@
// | github 代码仓库https://github.com/zoujingli/think-plugs-static // | github 代码仓库https://github.com/zoujingli/think-plugs-static
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
$(function () { require(['ThinkAdmin'], function () {
window.$body = $('body'); window.$body = $('body');

View File

@ -1,3 +1,17 @@
// +----------------------------------------------------------------------
// | Static Plugin for ThinkAdmin
// +----------------------------------------------------------------------
// | 版权所有 2014~2023 Anyon <zoujingli@qq.com>
// +----------------------------------------------------------------------
// | 官方网站: https://thinkadmin.top
// +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org )
// | 免责声明 ( https://thinkadmin.top/disclaimer )
// +----------------------------------------------------------------------
// | gitee 代码仓库https://gitee.com/zoujingli/think-plugs-static
// | github 代码仓库https://github.com/zoujingli/think-plugs-static
// +----------------------------------------------------------------------
define(function () { define(function () {
/*! 定义构造函数 */ /*! 定义构造函数 */

View File

@ -0,0 +1,99 @@
// +----------------------------------------------------------------------
// | Static Plugin for ThinkAdmin
// +----------------------------------------------------------------------
// | 版权所有 2014~2023 Anyon <zoujingli@qq.com>
// +----------------------------------------------------------------------
// | 官方网站: https://thinkadmin.top
// +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org )
// | 免责声明 ( https://thinkadmin.top/disclaimer )
// +----------------------------------------------------------------------
// | gitee 代码仓库https://gitee.com/zoujingli/think-plugs-static
// | github 代码仓库https://github.com/zoujingli/think-plugs-static
// +----------------------------------------------------------------------
define(function () {
var doAjax = true, doReload = false;
var template = '<div class="padding-30 padding-bottom-0" data-queue-load="{{d.code}}"><div class="layui-elip notselect nowrap" data-message-title><b class="color-desc">...</b></div><div class="margin-top-15 layui-progress layui-progress-big" lay-showPercent="yes"><div class="layui-progress-bar transition" lay-percent="0.00%"></div></div>' + '<div class="margin-top-15"><code class="layui-textarea layui-bg-black border-0" style="resize:none;overflow:hidden;height:190px"></code></div></div>';
return function (code, doScript, element) {
layer.open({
type: 1, title: false, area: ['560px', '315px'], anim: 2, shadeClose: false, end: function () {
doAjax = doReload && doScript && $.layTable.reload(((element || {}).dataset || {}).tableId || true)
}, content: laytpl(template).render({code: code}), success: function ($elem) {
new Progress($elem, code, doScript);
}
});
}
function Progress($elem, code, doScript) {
var that = this;
this.$box = $elem.find('[data-queue-load=' + code + ']');
if (doAjax === false || this.$box.length < 1) return false;
this.$code = this.$box.find('code');
this.$title = this.$box.find('[data-message-title]');
this.$percent = this.$box.find('.layui-progress div');
// 设置数据缓存
this.SetCache = function (code, index, value) {
var ckey = code + '_' + index, ctype = 'admin-queue-script';
return value !== undefined ? layui.data(ctype, {key: ckey, value: value}) : layui.data(ctype)[ckey] || 0;
};
// 更新任务显示状态
this.SetState = function (status, message) {
if (message.indexOf('javascript:') === -1) if (status === 1) {
that.$title.html('<b class="color-text">' + message + '</b>').addClass('text-center');
that.$percent.addClass('layui-bg-blue').removeClass('layui-bg-green layui-bg-red');
} else if (status === 2) {
if (message.indexOf('>>>') > -1) {
that.$title.html('<b class="color-blue">' + message + '</b>').addClass('text-center');
} else {
that.$title.html('<b class="color-blue">正在处理:</b>' + message).removeClass('text-center');
}
that.$percent.addClass('layui-bg-blue').removeClass('layui-bg-green layui-bg-red');
} else if (status === 3) {
doReload = true;
that.$title.html('<b class="color-green">' + message + '</b>').addClass('text-center');
that.$percent.addClass('layui-bg-green').removeClass('layui-bg-blue layui-bg-red');
} else if (status === 4) {
that.$title.html('<b class="color-red">' + message + '</b>').addClass('text-center');
that.$percent.addClass('layui-bg-red').removeClass('layui-bg-blue layui-bg-green');
}
};
// 读取任务进度信息
this.LoadProgress = function () {
if (doAjax === false || that.$box.length < 1) return false;
$.form.load(tapiRoot + '/api.queue/progress', {code: code}, 'post', function (ret) {
if (ret.code) {
var lines = [];
for (var idx in ret.data.history) {
var line = ret.data.history[idx], percent = '[ ' + line.progress + '% ] ';
if (line.message.indexOf('javascript:') === -1) {
lines.push(line.message.indexOf('>>>') > -1 ? line.message : percent + line.message);
} else if (!that.SetCache(code, idx) && doScript !== false) {
that.SetCache(code, idx, 1)
$.form.goto(line.message);
}
}
if (ret.data.status > 0) {
that.SetState(parseInt(ret.data.status), ret.data.message);
that.$percent.attr('lay-percent', (parseFloat(ret.data.progress || '0.00').toFixed(2)) + '%') && layui.element.render();
that.$code.html('<p class="layui-elip">' + lines.join('</p><p class="layui-elip">') + '</p>').animate({scrollTop: that.$code[0].scrollHeight + 'px'}, 200);
parseInt(ret.data.status) === 3 || parseInt(ret.data.status) === 4 || setTimeout(that.LoadProgress, Math.floor(Math.random() * 200));
} else {
setTimeout(that.LoadProgress, Math.floor(Math.random() * 500) + 200);
}
return false;
}
}, false);
};
// 首页加载进度信息
this.LoadProgress();
}
});

View File

@ -0,0 +1,114 @@
// +----------------------------------------------------------------------
// | Static Plugin for ThinkAdmin
// +----------------------------------------------------------------------
// | 版权所有 2014~2023 Anyon <zoujingli@qq.com>
// +----------------------------------------------------------------------
// | 官方网站: https://thinkadmin.top
// +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org )
// | 免责声明 ( https://thinkadmin.top/disclaimer )
// +----------------------------------------------------------------------
// | gitee 代码仓库https://gitee.com/zoujingli/think-plugs-static
// | github 代码仓库https://github.com/zoujingli/think-plugs-static
// +----------------------------------------------------------------------
define(function () {
return function (form, callable, onConfirm) {
var that = this;
// 绑定表单元素
this.form = $(form);
// 检测表单元素
this.tags = 'input,textarea';
// 绑定元素事件,
this.evts = 'blur change';
// 预设检测规则
this.patterns = {
phone: '^1[3-9][0-9]{9}$',
email: '^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$',
_qq_: '^[1-9][0-9]{4,11}$',
_ip_: '^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$',
_url_: '^((https?|ftp|file):\\/\\/)?([\\da-z\\.-]+)\\.([a-z\\.]{2,6})([\\/\\w \\.-]*)*\\/?$',
_wechat_: '^[a-zA-Z]([-_a-zA-Z0-9]{5,19})+$',
_cardid_: '^[1-9]\\d{5}(18|19|([23]\\d))\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$',
_userame_: '^[a-zA-Z0-9_-]{4,16}$',
};
// 检测属性是否有定义
this.hasProp = function (el, prop) {
var attrProp = el.getAttribute(prop);
return typeof attrProp !== 'undefined' && attrProp !== null && attrProp !== false;
};
this.isRegex = function (el) {
var real = $.trim($(el).val());
var regexp = el.getAttribute('pattern');
regexp = this.patterns[regexp] || regexp;
if (real === "" || !regexp) return true;
return new RegExp(regexp, 'i').test(real);
};
this.checkAllInput = function () {
var status = true;
return this.form.find(this.tags).each(function () {
!that.checkInput(this) && status && (status = !$(this).focus());
}) && status;
};
this.checkInput = function (el) {
if (this.hasProp(el, 'data-auto-none')) return true;
var type = (el.getAttribute('type') || '').replace(/\W+/, '').toLowerCase();
if ($.inArray(type, ['file', 'reset', 'image', 'radio', 'checkbox', 'submit', 'hidden']) > -1) return true;
if (this.hasProp(el, 'required') && $.trim($(el).val()) === '') return this.remind(el, 'required');
return this.isRegex(el) ? !!this.hideError(el) : this.remind(el, 'pattern');
};
this.remind = function (el, type, tips) {
return $(el).is(':visible') ? this.showError(el, tips || el.getAttribute(type + '-error') || function (name, tips) {
return name ? name + (type === 'required' ? '不能为空' : "格式错误") : (tips || el.getAttribute('placeholder') || '输入格式错误');
}(el.getAttribute('vali-name') || el.getAttribute('data-vali-name'), el.getAttribute('title'))) && false : true;
};
this.showError = function (el, tip) {
return this.insertError($(el).addClass('validate-error')).addClass('layui-anim-fadein').css({width: 'auto'}).html(tip);
};
this.hideError = function (el) {
return this.insertError($(el).removeClass('validate-error')).removeClass('layui-anim-fadein').css({width: '30px'}).html('');
};
this.insertError = function (el) {
if ($(el).data('input-info')) return $(el).data('input-info');
var $html = $('<span class="absolute block layui-anim text-center font-s12 notselect" style="color:#A44;z-index:2"></span>');
var $next = $(el).nextAll('.input-right-icon'), right = ($next ? $next.width() + parseFloat($next.css('right') || '0') : 0) + 10;
var style = {top: $(el).position().top + 'px', right: right + 'px', lineHeight: el.nodeName === 'TEXTAREA' ? '32px' : $(el).css('height')};
$(el).data('input-info', $html.css(style).insertAfter(el));
return $html;
};
/*! 预埋异常标签*/
this.form.find(this.tags).each(function () {
that.hideError(this, '');
});
/*! 表单元素验证 */
this.form.attr({onsubmit: 'return false', novalidate: 'novalidate', autocomplete: 'off'}).on('keydown', this.tags, function () {
that.hideError(this)
}).off(this.evts, this.tags).on(this.evts, this.tags, function () {
that.checkInput(this);
}).data('validate', this).bind('submit', function (event) {
event.preventDefault();
/* 检查所有表单元素是否通过H5的规则验证 */
if (that.checkAllInput() && typeof callable === 'function') {
if (typeof CKEDITOR === 'object' && typeof CKEDITOR.instances === 'object') {
for (var i in CKEDITOR.instances) CKEDITOR.instances[i].updateElement();
}
/* 触发表单提交后,锁定三秒不能再次提交表单 */
if (that.form.attr('submit-locked')) return false;
var submit = that.form.find('button[type=submit],button:not([type=button])');
onConfirm(submit.attr('data-confirm'), function () {
that.form.attr('submit-locked', 1);
submit.addClass('submit-button-loading');
callable.call(form, that.form.formToJson(), []);
setTimeout(function () {
that.form.removeAttr('submit-locked');
submit.removeClass('submit-button-loading');
}, 3000);
});
}
}).find('[data-form-loaded]').map(function () {
$(this).html(this.dataset.formLoaded || this.innerHTML);
$(this).removeAttr('data-form-loaded').removeClass('layui-disabled');
});
}
});

File diff suppressed because one or more lines are too long