账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    单图上传改为多图上传,后台就接收不到数据了?
    33
    0
    <input type="file" multiple accept="image/png,image/gif,image/jpeg" @change="getFile($event)">
        
    //获取input
    getFile:function(e){
        this.file = e.target.files;
    },
    
    //创建
    creation:function(){
        console.log(this.file);
        let formData = new FormData();
        formData.append('file', this.file);
        formData.append('name', 'tomorrow');
            headers : { 
                'Content-type': 'multipart/form-data'
            }
        })
        .then(res => {
            //创建成功
        })
    },
    

    之前是单图上传的,后台可以接收得到数据。现在需求变了改为多图上传
    我把

    this.file = e.target.files[0];
    

    改为

    this.file = e.target.files;
    

    按道理应该是这样的吧,可后台就接收不到数据了?

    0
    打赏
    收藏
    点击回答
        全部回答
    • 0
    • 烟敛寒林 普通会员 1楼
      502 Bad Gateway

      502 Bad Gateway


      nginx
    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部