作者 lyh

gx

... ... @@ -175,7 +175,7 @@ class ImageController
$hash = hash_file('md5', $file->getPathname());
$image_hash = $imageModel->read(['hash'=>$hash]);
if($image_hash !== false){
$data['images'][] = $hash;
$data[] = ['image'=>$hash];
continue;
}
$url = $this->path;
... ... @@ -192,10 +192,10 @@ class ImageController
'hash' => $hash,
'type'=>$file->getClientOriginalExtension(),
];
$data['images'][] = $hash;
$data[] = ['image'=>$hash];
}
$imageModel->insert($save_data);
return $this->response('图片资源',Code::SUCCESS,['images'=>$data]);
return $this->response('图片资源',Code::SUCCESS,$data);
}
//下载
... ... @@ -247,15 +247,6 @@ class ImageController
case 'image':
$data['image_link'] = url('/b/image/' . $v);
break;
case 'images':
$v = explode(',',$v);
foreach ($v as $k1=>$v1){
$data['images_link'][$k1] = url('/b/image/' . $v1);
}
break;
case 'file':
$data['file_link'] = url('/b/file_hash/' . $v);
break;
}
}
}
... ...