作者 赵彬吉

update

@@ -113,6 +113,10 @@ class KeywordPageAiContent extends Command @@ -113,6 +113,10 @@ class KeywordPageAiContent extends Command
113 $prefix = empty($affix['prefix']) ? explode("\n", $default_affix['prefix']) : explode("\n", $affix['prefix']); 113 $prefix = empty($affix['prefix']) ? explode("\n", $default_affix['prefix']) : explode("\n", $affix['prefix']);
114 $suffix = empty($affix['suffix']) ? explode("\n", $default_affix['suffix']) : explode("\n", $affix['suffix']); 114 $suffix = empty($affix['suffix']) ? explode("\n", $default_affix['suffix']) : explode("\n", $affix['suffix']);
115 115
  116 + $lang = WebLanguage::getLangById($this->project['main_lang_id']??1);
  117 + $prefix = Translate::tran($prefix, $lang['short']);
  118 + $suffix = Translate::tran($suffix, $lang['short']);
  119 +
116 if (!$prefix || !$suffix) { 120 if (!$prefix || !$suffix) {
117 throw new ValidateException('扩展标题前后缀不存在'); 121 throw new ValidateException('扩展标题前后缀不存在');
118 } 122 }
@@ -197,13 +201,9 @@ class KeywordPageAiContent extends Command @@ -197,13 +201,9 @@ class KeywordPageAiContent extends Command
197 //打乱顺序 201 //打乱顺序
198 shuffle($prefix); 202 shuffle($prefix);
199 shuffle($suffix); 203 shuffle($suffix);
200 - //标题(title):{聚合页扩展标题前缀} keywords {聚合页扩展标题后缀} {聚合页扩展标题后缀}  
201 -  
202 - $title = sprintf('%s %s %s %s', $prefix[0], $title, $suffix[0], $suffix[1]);  
203 204
204 - $lang = WebLanguage::getLangById($this->project['main_lang_id']??1);  
205 -  
206 - return Translate::tran($title, $lang['short']); 205 + //标题(title):{聚合页扩展标题前缀} keywords {聚合页扩展标题后缀} {聚合页扩展标题后缀}
  206 + return sprintf('%s %s %s %s', $prefix[0], $title, $suffix[0], $suffix[1]);
207 } 207 }
208 208
209 209
@@ -256,7 +256,7 @@ class KeywordPageAiContent extends Command @@ -256,7 +256,7 @@ class KeywordPageAiContent extends Command
256 foreach ($body->childNodes as $child) { 256 foreach ($body->childNodes as $child) {
257 $modifiedHtml .= $dom->saveHTML($child); 257 $modifiedHtml .= $dom->saveHTML($child);
258 } 258 }
259 - return $modifiedHtml; 259 + return html_entity_decode($modifiedHtml, ENT_QUOTES | ENT_HTML5, 'UTF-8');
260 } 260 }
261 261
262 public function sendNotify($project_id) 262 public function sendNotify($project_id)