改进redis的get方法

This commit is contained in:
thinkphp
2017-10-17 16:12:55 +08:00
parent b14f58d717
commit 03d4502043

View File

@@ -80,7 +80,7 @@ class Redis extends Driver
public function get($name, $default = false) public function get($name, $default = false)
{ {
$value = $this->handler->get($this->getCacheKey($name)); $value = $this->handler->get($this->getCacheKey($name));
if (is_null($value)) { if (is_null($value) || false === $value) {
return $default; return $default;
} }
$jsonData = json_decode($value, true); $jsonData = json_decode($value, true);