Browse Source

Merge branch 'http_test' of git.xiaojukeji.com:jacklijiajia/thoth-frontend into http_test

qinzhipeng_v 5 years ago
parent
commit
92a846a2d2
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/utils/handleTinymce.js

+ 5 - 1
src/utils/handleTinymce.js

@@ -74,7 +74,11 @@ export function updateFile(file) { // 上传图片
 export async function setNewHtmlString(fileList, nowHandleText) { // 更换图片地址
 export async function setNewHtmlString(fileList, nowHandleText) { // 更换图片地址
   const reg = /<img.*?(?:>|\/>)/gi
   const reg = /<img.*?(?:>|\/>)/gi
   nowHandleText = nowHandleText.replace(reg, function(match, ...rest) {
   nowHandleText = nowHandleText.replace(reg, function(match, ...rest) {
-    return fileList.shift()
+    if (rest[1].indexOf('base64') > 0) {
+      return fileList.shift()
+    } else {
+      return rest[1]
+    }
   })
   })
   return nowHandleText
   return nowHandleText
 }
 }