Explorar el Código

fix: 富文本上传改为相对地址

sunhongyao341504 hace 1 año
padre
commit
23660ebf9a

+ 8 - 5
src/views/message/sysnotion-config/compontents/ContentConfig.vue

@@ -95,7 +95,10 @@
   /**
    * 表单相关操作
    */
-  type Rule = Pick<RuleFormView, 'introduction' | 'contentType' | 'content' | 'operator' | 'contentUrl'>;
+  type Rule = Pick<
+    RuleFormView,
+    'introduction' | 'contentType' | 'content' | 'operator' | 'contentUrl'
+  >;
   const ruleForm = ref<Rule>({
     introduction: '',
     contentType: ContentTypeEnum.RICHTEXT,
@@ -147,10 +150,10 @@
     placeholder: '请输入内容...',
     MENU_CONF: {},
   };
-  
+
   editorConfig.MENU_CONF!['uploadImage'] = {
     // 上传图片的配置
-    server: '/eye_api_bak/api/systemMessage/uploadPicture', // form-data fieldName ,默认值 'wangeditor-uploaded-image'
+    server: './eye_api_bak/api/systemMessage/uploadPicture', // form-data fieldName ,默认值 'wangeditor-uploaded-image'
     fieldName: 'file',
     // 单个文件的最大体积限制,默认为 2M
     maxFileSize: 5 * 1024 * 1024, // 1M
@@ -161,7 +164,7 @@
     // 自定义上传参数。参数会被添加到 formData 中,一起上传到服务端。
     meta: {
       bizType: 'PUSH_MESSAGE',
-      fileName: ''
+      fileName: '',
     },
     // 将 meta 拼接到 url 参数中,默认 false
     metaWithUrl: false,
@@ -178,7 +181,7 @@
     timeout: 10 * 1000, // 5 秒
     // 上传之前触发
     onBeforeUpload(file) {
-      console.log('file: ', file); 
+      console.log('file: ', file);
       return file;
       // 可以 return
       // 1. return file 或者 new 一个 file ,接下来将上传