qianwei
qianwei
  • 发布:2019-10-24 10:41
  • 更新:2020-07-10 16:35
  • 阅读:1226

uni.uploadFile上传时报错,查看控制台的接口,接口没有任何参数

分类:uni-app

这是上传的代码
附件有查看控制台的图片,请求参数里面什么都没有

 selectPic(type) {  
                let this_ = this  
                uni.chooseImage({  
                    count: 1,  
                    sourceType: [type],  
                    success: (res) => {  
                        console.log(res)  
                        this_.close('headPic')  
                        this_.picSrc = res.tempFilePaths[0]  
                        const tempFilePaths = res.tempFilePaths;  
                        const token = uni.getStorageSync('token');  
                        uni.uploadFile({  
                            url: 'http://148.70.55.201:8089/backwordSystem/uploadFile',   
                            filePath: tempFilePaths[0],  
                            fileType: "image",  
                            name: 'file',  
                            header: {  
                                'X-Token': token  
                            },  
                            formData: {  
                                    userId: this.userId,  
                                    userIdenty: "1"  
                            },  
                            success: (uploadFileRes)=>{  
                                console.log(uploadFileRes);  
                                this.userImg="http://148.70.55.201:8089/backwordSystem"+uploadFileRes.data.data  
                                this.$minApi.updatetUserInfo({  
                                    userIdenty: 1,  
                                    id: this.userId,  
                                    avatarPath: this.userImg  
                                }).then(data => {  
                                    console.log(data)  
                                    // this.getUserInfo()  
                                })  
                            }   
                        });  
                    },  

                })  
            }
2019-10-24 10:41 负责人:无 分享
已邀请:
l***@163.com

l***@163.com - 初学者

请问这个问题您最后解决了么?

5***@qq.com

5***@qq.com

请问解决了吗,我也是这个问题

该问题目前已经被锁定, 无法添加新回复