Browse Source

[fix] title

wenliming 2 năm trước cách đây
mục cha
commit
a157534431
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  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) || '';
 };