From 03b9c75106a9af90ed24532b1ccfaed23d3ea62a Mon Sep 17 00:00:00 2001 From: thinkphp Date: Sat, 24 Sep 2016 21:10:32 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B7=AF=E7=94=B1cache=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=95=B0=E7=BB=84=20=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E7=BC=93=E5=AD=98=E6=A0=87=E8=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/think/Route.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/library/think/Route.php b/library/think/Route.php index 12368037..384ab2dc 100644 --- a/library/think/Route.php +++ b/library/think/Route.php @@ -1413,7 +1413,14 @@ class Route } // 开启请求缓存 if ($request->isGet() && !empty($option['cache'])) { - $request->cache($pathinfo, $option['cache']); + $cache = $option['cache']; + if (is_array($cache)) { + list($key, $expire) = $cache; + } else { + $key = $pathinfo; + $expire = $cache; + } + $request->cache($key, $expire); } return $result; }