uni.uploadFile({
            url: 'https://www.example.com/upload', //仅为示例,非真实的接口地址
            filePath: tempFilePaths[0],
            name: 'file',
            formData: {
                'user': 'test'
            },
            success: (uploadFileRes) => {
                console.log(uploadFileRes.data);
            }
        });

  跟官网一样,不能设置header的content-type,不然会破坏结构

posted on 2020-01-15 09:45  随心的博客  阅读(1594)  评论(0编辑  收藏  举报