代码:
参数:
fileList:[],
方法:
imgSuccess(e){
uni.uploadFile({
url: this.$imgUpload,
filePath: e.file.url,
name: 'photo',
formData: {
'code': uni.getStorageSync('token')
},
success: (res) => {
const resData = JSON.parse(res.data);
if(resData.code!=0){
uni.showToast({title:resData.msg,icon:"none"});return;
}
//uni.showToast({title:resData.msg,icon:"none"});
this.form.photo=this.$imgsrc+resData.data;
}
});
},
对比前,替换掉前缀
$info["photo"]=str_replace($this->baseUrl,"",$info["photo"]);