|
@@ -35,23 +35,24 @@ class LoadDistData
|
|
|
}
|
|
|
|
|
|
// 检查模板是否需要更新
|
|
|
- if (
|
|
|
- !$dist?->publishList?->template_local_code ||
|
|
|
- !empty($dist?->publishList?->template_update_code) ||
|
|
|
- $dist?->publishList?->template_update_code !== $dist?->publishList?->template_local_code
|
|
|
- ) {
|
|
|
+ if(!empty($dist?->publishList?->template_update_code)) {
|
|
|
+ if (
|
|
|
+ !$dist?->publishList?->template_local_code ||
|
|
|
+ $dist?->publishList?->template_update_code !== $dist?->publishList?->template_local_code
|
|
|
+ ) {
|
|
|
|
|
|
- // dd('update template');
|
|
|
- // 更新模板
|
|
|
- TemplateUpdater::updateTemplates($dist);
|
|
|
+ // dd('update template');
|
|
|
+ // 更新模板
|
|
|
+ TemplateUpdater::updateTemplates($dist);
|
|
|
|
|
|
- // 清除缓存并重新获取
|
|
|
- SiteCache::clearDistCache($domain);
|
|
|
- $dist = SiteCache::getDist($domain);
|
|
|
- $dist = $dist ? unserialize($dist) : null;
|
|
|
+ // 清除缓存并重新获取
|
|
|
+ SiteCache::clearDistCache($domain);
|
|
|
+ $dist = SiteCache::getDist($domain);
|
|
|
+ $dist = $dist ? unserialize($dist) : null;
|
|
|
|
|
|
- if (!$dist) {
|
|
|
- abort(404, 'site not found.');
|
|
|
+ if (!$dist) {
|
|
|
+ abort(404, 'site not found.');
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|