作者 刘锟

amp站点图片添加宽高属性

... ... @@ -28,11 +28,11 @@ class WebSettingAmpLogic extends BaseLogic
return $this->success();
}
//log图处理
$info['top_logo'] = getImageUrl($info['top_logo'],$this->user['storage_type'],$this->user['project_location']);
$info['top_logo']['url'] = getImageUrl($info['top_logo']['url'], $this->user['storage_type'], $this->user['project_location']);
//banner处理
if (!empty($info['index_banner'])) {
foreach ($info['index_banner'] as &$v) {
$v = getImageUrl($v,$this->user['storage_type'],$this->user['project_location']);
$v['url'] = getImageUrl($v['url'], $this->user['storage_type'], $this->user['project_location']);
}
}
return $this->success($info);
... ... @@ -48,11 +48,15 @@ class WebSettingAmpLogic extends BaseLogic
{
try {
//log图处理
$this->param['top_logo'] = str_replace_url($this->param['top_logo'] ?? '');
if (isset($this->param['top_logo']) && $this->param['top_logo']) {
$this->param['top_logo']['url'] = str_replace_url($this->param['top_logo']['url'] ?? '');
}
$this->param['top_logo'] = Arr::a2s($this->param['top_logo'] ?? []);
//banner处理
$index_banner = [];
if (isset($this->param['index_banner']) && $this->param['index_banner']) {
foreach ($this->param['index_banner'] as $v) {
$v['url'] = str_replace_url($v['url'] ?? '');
$index_banner[] = str_replace_url($v);
}
}
... ...