wesmiler 2 месяцев назад
Родитель
Сommit
fec9e036bf
2 измененных файлов с 2 добавлено и 2 удалено
  1. 1 1
      app/Services/Api/ArticleService.php
  2. 1 1
      app/Services/Common/ArticleService.php

+ 1 - 1
app/Services/Api/ArticleService.php

@@ -158,7 +158,7 @@ class ArticleService extends BaseService
             $info['create_time'] = $info['create_time']? datetime($info['create_time'],'Y-m-d H.i.s') : '';
             $info['cover'] = get_image_url($info['cover']);
             if($info['content_type'] == 2){
-                $info['content'] = json_decode($info['content'],true);
+                $info['content'] = json_decode(format_content($info['content']),true);
             }else{
                 $info['content'] = get_format_content($info['content']);
             }

+ 1 - 1
app/Services/Common/ArticleService.php

@@ -100,7 +100,7 @@ class ArticleService extends BaseService
             foreach ($list['data'] as &$item) {
                 $item['create_time'] = $item['create_time'] ? datetime($item['create_time'], 'Y-m-d H.i.s') : '';
                 $item['cover'] = $item['cover'] ? get_image_url($item['cover']) : '';
-                $item['content'] = $item['content'] ? ($item['content_type']==2? json_decode($item['content'],true):get_format_content($item['content'])) : '';
+                $item['content'] = $item['content'] ? ($item['content_type']==2? json_decode(format_content($item['content']),true):get_format_content($item['content'])) : '';
                 $item['type_name'] = isset($typrArr[$item['type']]) ? $typrArr[$item['type']] : '其他';
             }
         }