From ee8ad30b2bf882772b1ad5cfdfb35c89c93bd916 Mon Sep 17 00:00:00 2001 From: Anyon Date: Wed, 4 Mar 2020 10:11:37 +0800 Subject: [PATCH] ComposerUpdate --- app/admin/view/user/index_tab.html | 6 +----- composer.lock | 8 ++++---- vendor/composer/installed.json | 8 ++++---- vendor/services.php | 2 +- vendor/zoujingli/think-library/src/Library.php | 5 ----- .../think-library/src/extend/CodeExtend.php | 17 ++++++++++------- 6 files changed, 20 insertions(+), 26 deletions(-) diff --git a/app/admin/view/user/index_tab.html b/app/admin/view/user/index_tab.html index d2303dd93..5052f15c2 100644 --- a/app/admin/view/user/index_tab.html +++ b/app/admin/view/user/index_tab.html @@ -6,8 +6,4 @@
  • {$v}
  • {/if} {/foreach} - - - \ No newline at end of file + \ No newline at end of file diff --git a/composer.lock b/composer.lock index 7a7623501..3e67a1e61 100644 --- a/composer.lock +++ b/composer.lock @@ -909,12 +909,12 @@ "source": { "type": "git", "url": "https://github.com/zoujingli/ThinkLibrary.git", - "reference": "1cc8c40ac3bcdfa92dfb831445635946d69a6582" + "reference": "271cc2b1bc58c87c43391f4f4df253875019d4fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/1cc8c40ac3bcdfa92dfb831445635946d69a6582", - "reference": "1cc8c40ac3bcdfa92dfb831445635946d69a6582", + "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/271cc2b1bc58c87c43391f4f4df253875019d4fb", + "reference": "271cc2b1bc58c87c43391f4f4df253875019d4fb", "shasum": "", "mirrors": [ { @@ -958,7 +958,7 @@ ], "description": "ThinkPHP v6.0 Development Library", "homepage": "http://framework.thinkadmin.top", - "time": "2020-03-03T02:45:58+00:00" + "time": "2020-03-04T02:06:25+00:00" }, { "name": "zoujingli/wechat-developer", diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 3d375cc92..8992df31e 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -935,12 +935,12 @@ "source": { "type": "git", "url": "https://github.com/zoujingli/ThinkLibrary.git", - "reference": "1cc8c40ac3bcdfa92dfb831445635946d69a6582" + "reference": "271cc2b1bc58c87c43391f4f4df253875019d4fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/1cc8c40ac3bcdfa92dfb831445635946d69a6582", - "reference": "1cc8c40ac3bcdfa92dfb831445635946d69a6582", + "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/271cc2b1bc58c87c43391f4f4df253875019d4fb", + "reference": "271cc2b1bc58c87c43391f4f4df253875019d4fb", "shasum": "", "mirrors": [ { @@ -956,7 +956,7 @@ "ext-json": "*", "topthink/framework": "^6.0" }, - "time": "2020-03-03T02:45:58+00:00", + "time": "2020-03-04T02:06:25+00:00", "type": "library", "extra": { "think": { diff --git a/vendor/services.php b/vendor/services.php index d356f8d5d..653936e2a 100644 --- a/vendor/services.php +++ b/vendor/services.php @@ -1,5 +1,5 @@ 'think\\app\\Service', diff --git a/vendor/zoujingli/think-library/src/Library.php b/vendor/zoujingli/think-library/src/Library.php index e855a094d..70a9d8721 100644 --- a/vendor/zoujingli/think-library/src/Library.php +++ b/vendor/zoujingli/think-library/src/Library.php @@ -55,11 +55,6 @@ class Library extends Service $header['Access-Control-Allow-Headers'] = 'Authorization,Content-Type,If-Match,If-Modified-Since,If-None-Match,If-Unmodified-Since,X-Requested-With'; $header['Access-Control-Expose-Headers'] = 'User-Form-Token,User-Token,Token'; } - // 未配置数据库,跳过所有检查 - $host = $this->app->config->get('database.host', '[host]'); - if (empty($host) || $host === '[host]') { - return $next($request)->header($header); - } // 访问模式及访问权限检查 if ($request->isOptions()) { return response()->code(204)->header($header); diff --git a/vendor/zoujingli/think-library/src/extend/CodeExtend.php b/vendor/zoujingli/think-library/src/extend/CodeExtend.php index 0a3e960f4..8a96b5b3c 100644 --- a/vendor/zoujingli/think-library/src/extend/CodeExtend.php +++ b/vendor/zoujingli/think-library/src/extend/CodeExtend.php @@ -26,16 +26,17 @@ class CodeExtend * 获取随机字符串编码 * @param integer $size 字符串长度 * @param integer $type 字符串类型(1纯数字,2纯字母,3数字字母) + * @param string $prefix 编码前缀 * @return string */ - public static function random($size = 10, $type = 1) + public static function random($size = 10, $type = 1, $prefix = '') { $numbs = '0123456789'; $chars = 'abcdefghijklmnopqrstuvwxyz'; if (intval($type) === 1) $chars = $numbs; - if (intval($type) === 2) $chars = "a{$chars}"; + if (intval($type) === 2) $chars = "{$chars}"; if (intval($type) === 3) $chars = "{$numbs}{$chars}"; - $string = $chars[rand(1, strlen($chars) - 1)]; + $string = $prefix . $chars[rand(1, strlen($chars) - 1)]; if (isset($chars)) while (strlen($string) < $size) { $string .= $chars[rand(0, strlen($chars) - 1)]; } @@ -45,12 +46,13 @@ class CodeExtend /** * 唯一日期编码 * @param integer $size + * @param string $prefix * @return string */ - public static function uniqidDate($size = 16) + public static function uniqidDate($size = 16, $prefix = '') { if ($size < 14) $size = 14; - $string = date('Ymd') . (date('H') + date('i')) . date('s'); + $string = $prefix . date('Ymd') . (date('H') + date('i')) . date('s'); while (strlen($string) < $size) $string .= rand(0, 9); return $string; } @@ -58,13 +60,14 @@ class CodeExtend /** * 唯一数字编码 * @param integer $size + * @param string $prefix * @return string */ - public static function uniqidNumber($size = 12) + public static function uniqidNumber($size = 12, $prefix = '') { $time = time() . ''; if ($size < 10) $size = 10; - $string = ($time[0] + $time[1]) . substr($time, 2) . rand(0, 9); + $string = $prefix . ($time[0] + $time[1]) . substr($time, 2) . rand(0, 9); while (strlen($string) < $size) $string .= rand(0, 9); return $string; }