diff --git a/themes/beauty/controller/SiteController.php b/themes/beauty/controller/SiteController.php index 069fc63..fda45ea 100644 --- a/themes/beauty/controller/SiteController.php +++ b/themes/beauty/controller/SiteController.php @@ -172,6 +172,7 @@ Class SiteController extends Controller { $msg = 'OK'; $url = ''; $img_id = ''; + $size = 'orignal'; $cacheId = $this->post('cid', ''); $cateId = $this->post('id', ''); @@ -192,6 +193,11 @@ Class SiteController extends Controller { } } + //弃用老版本数据格式,抛弃没有size属性的 + if (!empty($cachedData) && empty($cachedData['size'])) { + $cachedData = null; + } + if (empty($cachedData)) { //从缓存数据中获取目录的realpath $cachedData = Common::getCacheFromFile($cacheId); @@ -219,7 +225,8 @@ Class SiteController extends Controller { if (!empty($cachedData)) { $url = $cachedData['snapshot']; $cacheSubDir = 'dir'; - Common::saveCacheToFile($cacheKey, compact('url', 'img_id'), $cacheSubDir); + $size = 'vm'; + Common::saveCacheToFile($cacheKey, compact('url', 'img_id', 'size'), $cacheSubDir); } } }else {