|
@@ -133,7 +133,7 @@ class ImageController extends Controller |
|
@@ -133,7 +133,7 @@ class ImageController extends Controller |
|
133
|
if (empty($files)) {
|
133
|
if (empty($files)) {
|
|
134
|
$this->response('没有上传的文件!', 400);
|
134
|
$this->response('没有上传的文件!', 400);
|
|
135
|
}
|
135
|
}
|
|
136
|
- $type = $this->param['type'];
|
136
|
+ $type = $this->request->post('type','single');
|
|
137
|
if ($type == 'multi') {
|
137
|
if ($type == 'multi') {
|
|
138
|
return $this->multi($files);
|
138
|
return $this->multi($files);
|
|
139
|
} else {
|
139
|
} else {
|
|
@@ -151,8 +151,7 @@ class ImageController extends Controller |
|
@@ -151,8 +151,7 @@ class ImageController extends Controller |
|
151
|
*/
|
151
|
*/
|
|
152
|
public function single($files){
|
152
|
public function single($files){
|
|
153
|
$hash = hash_file('md5', $files->getPathname());
|
153
|
$hash = hash_file('md5', $files->getPathname());
|
|
154
|
- var_dump($files->getClientOriginalExtension());
|
|
|
|
155
|
- die();
|
154
|
+
|
|
156
|
//查看文件是否存在
|
155
|
//查看文件是否存在
|
|
157
|
$imageModel = new ImageModel();
|
156
|
$imageModel = new ImageModel();
|
|
158
|
$image_hash = $imageModel->read(['hash'=>$hash]);
|
157
|
$image_hash = $imageModel->read(['hash'=>$hash]);
|