mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
ComposerUpdate
This commit is contained in:
parent
fc72ddd896
commit
7639414521
@ -10,7 +10,7 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><b>QRCode</b><br><span class="nowrap color-desc">公众号二维码</span></label>
|
||||
<div class="layui-input-block">
|
||||
<div class="pull-left notselect"><img alt="qrc" data-tips-image src="{$wechat.qrcode_url|down_file}" style="width:100px;margin-left:-7px"></div>
|
||||
<div class="pull-left notselect"><img alt="qrc" data-tips-image src="{$wechat.qrcode_url|down_file}" style="width:96px;margin-left:-7px"></div>
|
||||
<div class="pull-left padding-left-10">
|
||||
<p class="nowrap">微信昵称:{$wechat.user_nickname|default='-'}</p>
|
||||
<p class="nowrap">微信类型:{$wechat.service_type|default='-'} / {$wechat.service_verify == '未认证' ? '未认证' : '<span class="color-green">已认证</span>'}</p>
|
||||
|
8
composer.lock
generated
8
composer.lock
generated
@ -937,12 +937,12 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/zoujingli/ThinkLibrary.git",
|
||||
"reference": "810b66ebea4a261549df9163df0430f7794143fe"
|
||||
"reference": "3feaa83edec0dc5d4979f5eeb2eff872678bedec"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/810b66ebea4a261549df9163df0430f7794143fe",
|
||||
"reference": "810b66ebea4a261549df9163df0430f7794143fe",
|
||||
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/3feaa83edec0dc5d4979f5eeb2eff872678bedec",
|
||||
"reference": "3feaa83edec0dc5d4979f5eeb2eff872678bedec",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
@ -987,7 +987,7 @@
|
||||
],
|
||||
"description": "ThinkPHP v6.0 Development Library",
|
||||
"homepage": "http://thinkadmin.top",
|
||||
"time": "2020-08-20T10:09:01+00:00"
|
||||
"time": "2020-08-21T03:31:56+00:00"
|
||||
},
|
||||
{
|
||||
"name": "zoujingli/wechat-developer",
|
||||
|
8
vendor/composer/installed.json
vendored
8
vendor/composer/installed.json
vendored
@ -963,12 +963,12 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/zoujingli/ThinkLibrary.git",
|
||||
"reference": "810b66ebea4a261549df9163df0430f7794143fe"
|
||||
"reference": "3feaa83edec0dc5d4979f5eeb2eff872678bedec"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/810b66ebea4a261549df9163df0430f7794143fe",
|
||||
"reference": "810b66ebea4a261549df9163df0430f7794143fe",
|
||||
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/3feaa83edec0dc5d4979f5eeb2eff872678bedec",
|
||||
"reference": "3feaa83edec0dc5d4979f5eeb2eff872678bedec",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
@ -985,7 +985,7 @@
|
||||
"ext-mbstring": "*",
|
||||
"topthink/framework": "^6.0"
|
||||
},
|
||||
"time": "2020-08-20T10:09:01+00:00",
|
||||
"time": "2020-08-21T03:31:56+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"think": {
|
||||
|
2
vendor/services.php
vendored
2
vendor/services.php
vendored
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
// This file is automatically generated at:2020-08-20 18:35:29
|
||||
// This file is automatically generated at:2020-08-21 11:37:33
|
||||
declare (strict_types = 1);
|
||||
return array (
|
||||
0 => 'think\\admin\\Library',
|
||||
|
@ -28,47 +28,36 @@ class ValidateHelper extends Helper
|
||||
/**
|
||||
* 快捷输入并验证( 支持 规则 # 别名 )
|
||||
* @param array $rules 验证规则( 验证信息数组 )
|
||||
* @param string $type 输入方式 ( post. 或 get. )
|
||||
* @param string|array $input 输入内容 ( post. 或 get. )
|
||||
* @return array
|
||||
* age.max:100 => message // 最大值限定
|
||||
* age.require => message // 最大值限定
|
||||
* age.between:1,120 => message // 范围限定
|
||||
* name.require => message // 必填内容
|
||||
* name.between:1,120 => message // 范围限定
|
||||
* name.value => value // 固定字段数值内容
|
||||
* name.default => 100 // 获取并设置默认值
|
||||
* region.value => value // 固定字段数值内容
|
||||
* 更多规则参照 ThinkPHP 官方的验证类
|
||||
*/
|
||||
public function init(array $rules, $type = '')
|
||||
public function init(array $rules, $input = ''): array
|
||||
{
|
||||
list($data, $rule, $info, $alias) = [[], [], [], ''];
|
||||
foreach ($rules as $name => $message) {
|
||||
if (stripos($name, '#') !== false) {
|
||||
list($name, $alias) = explode('#', $name);
|
||||
}
|
||||
if (stripos($name, '.') === false) {
|
||||
if (is_numeric($name)) {
|
||||
$field = $message;
|
||||
if (is_string($message) && stripos($message, '#') !== false) {
|
||||
list($name, $alias) = explode('#', $message);
|
||||
$field = empty($alias) ? $name : $alias;
|
||||
}
|
||||
$data[$name] = input("{$type}{$field}");
|
||||
} else {
|
||||
$data[$name] = $message;
|
||||
}
|
||||
if (is_string($input)) {
|
||||
$input = trim($input, '.') ?: 'request';
|
||||
$input = $this->app->request->$input();
|
||||
}
|
||||
[$data, $rule, $info] = [[], [], []];
|
||||
foreach ($rules as $name => $message) if (is_numeric($name)) {
|
||||
[$name, $alias] = explode('#', $message . '#');
|
||||
$data[$name] = $input[($alias ?: $name)] ?? null;
|
||||
} elseif (strpos($name, '.') === false) {
|
||||
$data[$name] = $message;
|
||||
} elseif (preg_match('|^(.*?)\.(.*?)#(.*?)#?$|', $name . '#', $matches)) {
|
||||
[, $_key, $_rule, $alias] = $matches;
|
||||
if (in_array($_rule, ['value', 'default'])) {
|
||||
if ($_rule === 'value') $data[$_key] = $message;
|
||||
elseif ($_rule === 'default') $data[$_key] = $input[($alias ?: $_key)] ?? $message;
|
||||
} else {
|
||||
list($_rgx) = explode(':', $name);
|
||||
list($_key, $_rule) = explode('.', $name);
|
||||
if (in_array($_rule, ['value', 'default'])) {
|
||||
if ($_rule === 'value') {
|
||||
$data[$_key] = $message;
|
||||
} elseif ($_rule === 'default') {
|
||||
$data[$_key] = input($type . ($alias ?: $_key), $message);
|
||||
}
|
||||
} else {
|
||||
$info[$_rgx] = $message;
|
||||
$data[$_key] = $data[$_key] ?? input($type . ($alias ?: $_key));
|
||||
$rule[$_key] = empty($rule[$_key]) ? $_rule : "{$rule[$_key]}|{$_rule}";
|
||||
}
|
||||
$info[strstr($name, ':', true)] = $message;
|
||||
$data[$_key] = $data[$_key] ?? ($input[($alias ?: $_key)] ?? null);
|
||||
$rule[$_key] = isset($rule[$_key]) ? ($rule[$_key] . '|' . $_rule) : $_rule;
|
||||
}
|
||||
}
|
||||
$validate = new Validate();
|
||||
|
Loading…
x
Reference in New Issue
Block a user