瀏覽代碼

Merge branch 'dwhm' of http://39.105.160.25:10880/post-project-ui/post-ui into dwhm

一盏薄酒 2 年之前
父節點
當前提交
e970ace612
共有 1 個文件被更改,包括 11 次插入6 次删除
  1. 11 6
      src/views/issuer/issuer2/index.vue

+ 11 - 6
src/views/issuer/issuer2/index.vue

@@ -49,10 +49,10 @@
             <el-form-item label="上传头像:" prop="avatar">
               <el-upload
                 class="avatar-uploader"
-                action="#"
+                action="http://localhost:80/dev-api/files/send"
                 accept="image/*"
                 :show-file-list="false"
-                :http-request="handleUpload"
+                :on-success="handleAvatarSuccess"
               >
                 <img
                   v-if="ruleForm.avatar"
@@ -123,7 +123,7 @@
         // 表单校验规则
         rules: {
           // 发行方名称 校验规则 不能为空
-          name: [
+          issuerName: [
             { required: true, message: "请输入发行方名称", trigger: "blur" },
           ],
         },
@@ -222,17 +222,22 @@
           })
         }).catch(_=>_);
       },
+      // 修改--取消按钮
       cancel(){
         this.$router.back();
-      }
+      },
+      // 上传头像成功
+      handleAvatarSuccess(res, file) {
+        this.ruleForm.avatar = URL.createObjectURL(file.raw);
+      },
     },
+    
   };
   </script>
   
   <style>
   .announcementBox {
-    margin: 0 auto;
-    margin-top: 40px;
+    margin: 40px auto;
   }
   .avatar-uploader .el-upload {
     border: 1px dashed #d9d9d9;