Commit 48d20e08 authored by 顾文旭's avatar 顾文旭

fix redis

parent b25a9123
...@@ -87,7 +87,7 @@ class CacheUtil ...@@ -87,7 +87,7 @@ class CacheUtil
if (is_null($value) || false === $value) { if (is_null($value) || false === $value) {
return $default; return $default;
} }
return $value; return json_decode($value);
} }
/** /**
...@@ -123,9 +123,9 @@ class CacheUtil ...@@ -123,9 +123,9 @@ class CacheUtil
$key = $this->getCacheKey($prefix, $key); $key = $this->getCacheKey($prefix, $key);
//对数组/对象数据进行缓存处理,保证数据完整性 //对数组/对象数据进行缓存处理,保证数据完整性
if (is_int($expire) && $expire) { if (is_int($expire) && $expire) {
$result = $this->handler->setex($key, $expire, $value); $result = $this->handler->setex($key, $expire, json_encode($value));
} else { } else {
$result = $this->handler->set($key, $value); $result = $this->handler->set($key, json_encode($value));
} }
return $result; return $result;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment