|
...
|
...
|
@@ -16,7 +16,7 @@ use Intervention\Image\Facades\Image; |
|
|
|
|
|
|
|
class ImageController extends Controller
|
|
|
|
{
|
|
|
|
public $path = '';//路径
|
|
|
|
public $path = '/upload';//路径
|
|
|
|
|
|
|
|
public $config = '';//存储默认配置
|
|
|
|
|
|
...
|
...
|
@@ -291,7 +291,7 @@ class ImageController extends Controller |
|
|
|
*/
|
|
|
|
public function download(){
|
|
|
|
$imageModel = new ImageModel();
|
|
|
|
$info = $imageModel->read(['hash' => $this->param['hash']]);
|
|
|
|
$info = $imageModel->read(['path' => $this->param['path']]);
|
|
|
|
if ($info === false) {
|
|
|
|
$this->response('指定文件不存在!', Code::USER_ERROR);
|
|
|
|
}
|
|
...
|
...
|
@@ -404,11 +404,11 @@ class ImageController extends Controller |
|
|
|
*/
|
|
|
|
public function getDownloadUrl(){
|
|
|
|
$imageModel = new ImageModel();
|
|
|
|
$info = $imageModel->read(['hash' => $this->param['hash']]);
|
|
|
|
$info = $imageModel->read(['path' => $this->param['path']]);
|
|
|
|
if ($info === false) {
|
|
|
|
$this->response('指定文件不存在!', Code::USER_ERROR);
|
|
|
|
}
|
|
|
|
$data = ['image_download'=>url('a/downLoad/images?hash='.$this->param['hash'])];
|
|
|
|
$data = ['image_download'=>url('a/downLoad/images?path='.$this->param['path'])];
|
|
|
|
$this->response('success',Code::SUCCESS,$data);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|