作者 刘锟

amp站点图片添加宽高属性

@@ -28,11 +28,11 @@ class WebSettingAmpLogic extends BaseLogic @@ -28,11 +28,11 @@ class WebSettingAmpLogic extends BaseLogic
28 return $this->success(); 28 return $this->success();
29 } 29 }
30 //log图处理 30 //log图处理
31 - $info['top_logo'] = getImageUrl($info['top_logo'],$this->user['storage_type'],$this->user['project_location']); 31 + $info['top_logo']['url'] = getImageUrl($info['top_logo']['url'], $this->user['storage_type'], $this->user['project_location']);
32 //banner处理 32 //banner处理
33 if (!empty($info['index_banner'])) { 33 if (!empty($info['index_banner'])) {
34 foreach ($info['index_banner'] as &$v) { 34 foreach ($info['index_banner'] as &$v) {
35 - $v = getImageUrl($v,$this->user['storage_type'],$this->user['project_location']); 35 + $v['url'] = getImageUrl($v['url'], $this->user['storage_type'], $this->user['project_location']);
36 } 36 }
37 } 37 }
38 return $this->success($info); 38 return $this->success($info);
@@ -48,11 +48,15 @@ class WebSettingAmpLogic extends BaseLogic @@ -48,11 +48,15 @@ class WebSettingAmpLogic extends BaseLogic
48 { 48 {
49 try { 49 try {
50 //log图处理 50 //log图处理
51 - $this->param['top_logo'] = str_replace_url($this->param['top_logo'] ?? ''); 51 + if (isset($this->param['top_logo']) && $this->param['top_logo']) {
  52 + $this->param['top_logo']['url'] = str_replace_url($this->param['top_logo']['url'] ?? '');
  53 + }
  54 + $this->param['top_logo'] = Arr::a2s($this->param['top_logo'] ?? []);
52 //banner处理 55 //banner处理
53 $index_banner = []; 56 $index_banner = [];
54 if (isset($this->param['index_banner']) && $this->param['index_banner']) { 57 if (isset($this->param['index_banner']) && $this->param['index_banner']) {
55 foreach ($this->param['index_banner'] as $v) { 58 foreach ($this->param['index_banner'] as $v) {
  59 + $v['url'] = str_replace_url($v['url'] ?? '');
56 $index_banner[] = str_replace_url($v); 60 $index_banner[] = str_replace_url($v);
57 } 61 }
58 } 62 }