diff --git a/composer.lock b/composer.lock index 0b98be022..68cd00aed 100644 --- a/composer.lock +++ b/composer.lock @@ -937,12 +937,12 @@ "source": { "type": "git", "url": "https://github.com/zoujingli/ThinkLibrary.git", - "reference": "b236f9f14d4becb0f0dadf479ff2627490909af7" + "reference": "810b66ebea4a261549df9163df0430f7794143fe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/b236f9f14d4becb0f0dadf479ff2627490909af7", - "reference": "b236f9f14d4becb0f0dadf479ff2627490909af7", + "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/810b66ebea4a261549df9163df0430f7794143fe", + "reference": "810b66ebea4a261549df9163df0430f7794143fe", "shasum": "", "mirrors": [ { @@ -987,7 +987,7 @@ ], "description": "ThinkPHP v6.0 Development Library", "homepage": "http://thinkadmin.top", - "time": "2020-08-20T09:39:39+00:00" + "time": "2020-08-20T10:09:01+00:00" }, { "name": "zoujingli/wechat-developer", diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 5416e40c6..933ae338b 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -963,12 +963,12 @@ "source": { "type": "git", "url": "https://github.com/zoujingli/ThinkLibrary.git", - "reference": "b236f9f14d4becb0f0dadf479ff2627490909af7" + "reference": "810b66ebea4a261549df9163df0430f7794143fe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/b236f9f14d4becb0f0dadf479ff2627490909af7", - "reference": "b236f9f14d4becb0f0dadf479ff2627490909af7", + "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/810b66ebea4a261549df9163df0430f7794143fe", + "reference": "810b66ebea4a261549df9163df0430f7794143fe", "shasum": "", "mirrors": [ { @@ -985,7 +985,7 @@ "ext-mbstring": "*", "topthink/framework": "^6.0" }, - "time": "2020-08-20T09:39:39+00:00", + "time": "2020-08-20T10:09:01+00:00", "type": "library", "extra": { "think": { diff --git a/vendor/services.php b/vendor/services.php index 6c9ab89ec..58e5b7444 100644 --- a/vendor/services.php +++ b/vendor/services.php @@ -1,5 +1,5 @@ 'think\\admin\\Library', diff --git a/vendor/zoujingli/think-library/src/service/TokenService.php b/vendor/zoujingli/think-library/src/service/TokenService.php index 5b1982668..5e7f3c1ed 100644 --- a/vendor/zoujingli/think-library/src/service/TokenService.php +++ b/vendor/zoujingli/think-library/src/service/TokenService.php @@ -150,11 +150,7 @@ class TokenService extends Service private function _getCacheItem(string $token, $default = []) { $this->_clearTimeoutCache(); - if (isset($this->cachedata[$token])) { - return array_merge($this->cachedata[$token], ['token' => $token]); - } else { - return $default; - } + return $this->cachedata[$token] ?? $default; } /** @@ -181,6 +177,9 @@ class TokenService extends Service unset($this->cachedata[$key]); } } + if (count($this->cachedata) > 99) { + $this->cachedata = array_slice($this->cachedata, -99); + } return $this->cachedata; } } \ No newline at end of file