Authored by Rock Zhang

修复意见反馈上传图片返回的图片地址不正确的bug

... ... @@ -24,9 +24,6 @@ class Images
),
'yhb-head' => 'head.static.yhbimg.com'
);
private static $staticDomain = array(
'bucket' => ''
);
private static $qiniuDomain = 'yhfair.qiniudn.com';
/**
... ... @@ -171,7 +168,7 @@ class Images
$stream .= $twoHyphens.$boundary.$end;
$stream .="Content-Disposition: form-data; "."name=\"project\"".$end;
$stream .= $end;
$stream .= "sns";//project sns
$stream .= "suggest";//project sns
$stream .= $end;
$stream .= $twoHyphens .$boundary .$twoHyphens .$end;
$opts = array(
... ... @@ -185,7 +182,18 @@ class Images
$result = json_decode(file_get_contents('http://upload.static.yohobuy.com', false, $context), true);
if(!empty($result['data']['imagesList']))
{
return count($file) == 1 || !is_array($file) ? current($result['data']['imagesList']) : $result['data']['imagesList'] ;
if(count($file) == 1 || !is_array($file))
{
return self::getSourceUrl(current($result['data']['imagesList']), 'suggest');
}
else
{
foreach ($result['data']['imagesList'] as &$val) {
$val = self::getSourceUrl($val, 'suggest');
}
return $result['data']['imagesList'];
}
}
else
{
... ...