mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 20:52:48 +08:00
修正cache方法的变量规则检查位置
This commit is contained in:
@@ -1464,15 +1464,15 @@ class Request
|
||||
*/
|
||||
public function cache($key, $expire = null)
|
||||
{
|
||||
if (Cache::has($key)) {
|
||||
if (false !== strpos($key, ':')) {
|
||||
$param = $this->param();
|
||||
foreach ($param as $item => $val) {
|
||||
if (is_string($val) && false !== strpos($key, ':' . $item)) {
|
||||
$key = str_replace(':' . $item, $val, $key);
|
||||
}
|
||||
if (false !== strpos($key, ':')) {
|
||||
$param = $this->param();
|
||||
foreach ($param as $item => $val) {
|
||||
if (is_string($val) && false !== strpos($key, ':' . $item)) {
|
||||
$key = str_replace(':' . $item, $val, $key);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Cache::has($key)) {
|
||||
// 读取缓存
|
||||
$content = Cache::get($key);
|
||||
$response = Response::create($content)->header('Content-Type', Cache::get($key . '_header'));
|
||||
|
||||
Reference in New Issue
Block a user