소스 검색

静态知识图片占位符替换bug修改

zhouna 6 년 전
부모
커밋
347639a4f6
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      src/components/icss/AddMedicinePrompt.vue

+ 2 - 2
src/components/icss/AddMedicinePrompt.vue

@@ -109,7 +109,7 @@
               return {
                         title:it.title,
                         position:this.mapStringToNum(it.position),
-                        content:it.content.replace('{imageUrlPrefix}',config.imgHost),
+                        content:it.content.replace(/{imageUrlPrefix}/g,config.imgHost),
                         isReason:it.isReason,
                         text:it.text,
                         disabled:true};
@@ -215,7 +215,7 @@
           return Object.assign({},it,{
                                         position:typeof it.position=='string'?it.position:it.position.join(","),
                                         conceptId:this.form.conceptId,
-                                        content:it.content.replace(config.imgHost,'{imageUrlPrefix}')});
+                                        content:it.content.replace(new RegExp(config.imgHost,'g'),'{imageUrlPrefix}')});
         });
         this.showSaveDialog(param,'是否保存该静态知识?');
       },