正在显示
1 个修改的文件
包含
3 行增加
和
12 行删除
| @@ -175,7 +175,7 @@ class ImageController | @@ -175,7 +175,7 @@ class ImageController | ||
| 175 | $hash = hash_file('md5', $file->getPathname()); | 175 | $hash = hash_file('md5', $file->getPathname()); |
| 176 | $image_hash = $imageModel->read(['hash'=>$hash]); | 176 | $image_hash = $imageModel->read(['hash'=>$hash]); |
| 177 | if($image_hash !== false){ | 177 | if($image_hash !== false){ |
| 178 | - $data['images'][] = $hash; | 178 | + $data[] = ['image'=>$hash]; |
| 179 | continue; | 179 | continue; |
| 180 | } | 180 | } |
| 181 | $url = $this->path; | 181 | $url = $this->path; |
| @@ -192,10 +192,10 @@ class ImageController | @@ -192,10 +192,10 @@ class ImageController | ||
| 192 | 'hash' => $hash, | 192 | 'hash' => $hash, |
| 193 | 'type'=>$file->getClientOriginalExtension(), | 193 | 'type'=>$file->getClientOriginalExtension(), |
| 194 | ]; | 194 | ]; |
| 195 | - $data['images'][] = $hash; | 195 | + $data[] = ['image'=>$hash]; |
| 196 | } | 196 | } |
| 197 | $imageModel->insert($save_data); | 197 | $imageModel->insert($save_data); |
| 198 | - return $this->response('图片资源',Code::SUCCESS,['images'=>$data]); | 198 | + return $this->response('图片资源',Code::SUCCESS,$data); |
| 199 | } | 199 | } |
| 200 | 200 | ||
| 201 | //下载 | 201 | //下载 |
| @@ -247,15 +247,6 @@ class ImageController | @@ -247,15 +247,6 @@ class ImageController | ||
| 247 | case 'image': | 247 | case 'image': |
| 248 | $data['image_link'] = url('/b/image/' . $v); | 248 | $data['image_link'] = url('/b/image/' . $v); |
| 249 | break; | 249 | break; |
| 250 | - case 'images': | ||
| 251 | - $v = explode(',',$v); | ||
| 252 | - foreach ($v as $k1=>$v1){ | ||
| 253 | - $data['images_link'][$k1] = url('/b/image/' . $v1); | ||
| 254 | - } | ||
| 255 | - break; | ||
| 256 | - case 'file': | ||
| 257 | - $data['file_link'] = url('/b/file_hash/' . $v); | ||
| 258 | - break; | ||
| 259 | } | 250 | } |
| 260 | } | 251 | } |
| 261 | } | 252 | } |
-
请 注册 或 登录 后发表评论