作者 郭鑫
1 个管道 的构建 通过 耗费 0 秒

图片上传修改

... ... @@ -67,10 +67,7 @@ class MemberController extends CommentController
$imgurls .= ','. $url;
}
$data['imgurls'] = ltrim($imgurls,',');
$data['httpimgurls'] = cmf_get_image_preview_url($data['imgurls']);
$a['e'] = $data['imgurls'];
$a['f'] = $data['httpimgurls'];
Db::name('Test')->insertGetId($a);
$data['httpimgurls'] = cmf_get_image_preview_url($data['imgurls'][0]);
$this->apiResponse(1,'上传成功',$data);
}
... ...
... ... @@ -666,13 +666,11 @@
data: {media: localIds.toString()},
success: function (data) {
if (data.code == 1) {
var sonHtml = "<div class=\"img_add_box \">\n" +
" <img class=\" add_icon\" src=\""+data.data.httpimgurls+"\" alt=\"\">\n" +
" </div>";
$('.addImg').append(sonHtml);
$('#imghead').attr('src',data.data.imghead);
}
}
});
// http://yunzhi07.com/upload/petavatar/20181122/201811221333467917.jpg,petavatar/20181122/201811221333461851.jpg
// var serverId1 = res.serverId; // 返回图片的服务器端ID
// alert(serverId1);
},
... ...