作者 lyh

gx

@@ -150,7 +150,7 @@ class FileController @@ -150,7 +150,7 @@ class FileController
150 if (empty($files)) { 150 if (empty($files)) {
151 $this->response('没有上传的文件!', 400); 151 $this->response('没有上传的文件!', 400);
152 } 152 }
153 - $type = $this->param['type']; 153 + $type = $this->request->post('type','single');
154 if ($type == 'multi') { 154 if ($type == 'multi') {
155 return $this->multi($files); 155 return $this->multi($files);
156 } else { 156 } else {
@@ -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]);