var formData = new FormData();
formData.append("img",$("#photo")[0].files[0]); // img为传参时图片的参数
$.ajax({
type: 'POST',
url: url + "/api/v1/member/img",
data: formData,
processData: false,
contentType: false,
success: function(res){
var rs = JSON.parse(res);
if(rs.status == 200){
console.log(rs)
}else{
console.log(res.data)
}
}
});
jquery 图片上传
最新推荐文章于 2023-01-10 16:19:35 发布