浏览代码

[fix] title

wenliming 2 年之前
父节点
当前提交
a157534431
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      src/view/iframe/publish/tool-box/child/editor.vue

+ 3 - 0
src/view/iframe/publish/tool-box/child/editor.vue

@@ -142,6 +142,9 @@ const searchHandler = async () => {
 const getTitleByHtmlStr = (str) => {
   let index1 = str.indexOf('<title>') + 7;
   let index2 = str.indexOf('</title>');
+  if(index2 < 0) {
+    return '';
+  }
   return str.substring(index1, index2) || '';
 };