作者 lyh

gx

... ... @@ -435,9 +435,9 @@ if (!function_exists('getImageUrl')) {
if($info['is_cos'] == 1){
$cos = config('filesystems.disks.cos');
$cosCdn = $cos['cdn'];
$url = $cosCdn.'/upload'.$info['path'];
$url = $cosCdn.$info['path'];
}else{
$url = url('upload'.$info['path']);
$url = url($info['path']);
}
}else{
$url = $hash;
... ...
... ... @@ -261,11 +261,11 @@ class LoginController extends BaseController
}else{
$data = [
'code'=>0,
'message'=>'关注成功,请登录后绑定账号后扫码',
'message'=>'关注成功,请登录后绑定账号后扫码,如已绑定,请再次扫码',
];
}
return $data;
}
}
... ...
... ... @@ -222,7 +222,7 @@ class FileController
*/
public function downLoad(){
$file_model = new File();
$info = $file_model->read(['hash' => $this->param['hash']]);
$info = $file_model->read(['path' => $this->param['path']]);
if ($info === false) {
$this->response('指定文件不存在!', Code::USER_ERROR);
}
... ... @@ -314,11 +314,11 @@ class FileController
*/
public function getDownloadUrl(){
$fileModel = new File();
$info = $fileModel->read(['hash' => $this->param['hash']]);
$info = $fileModel->read(['path' => $this->param['path']]);
if ($info === false) {
$this->response('指定文件不存在!', Code::USER_ERROR);
}
$data = ['file_download'=>url('a/downLoad/files?hash='.$this->param['hash'])];
$data = ['file_download'=>url('a/downLoad/files?path='.$this->param['path'])];
$this->response('success',Code::SUCCESS,$data);
}
}
... ...
... ... @@ -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);
}
}
... ...
... ... @@ -30,7 +30,7 @@ class CosService
'secretKey' => $cos['credentials']['secretKey'],
],
]);
$key = 'upload'.$path.'/'.$filename;
$key = $path.'/'.$filename;
$cosClient->putObject([
'Bucket' => $cos['bucket'],
'Key' => $key,
... ...
... ... @@ -19,15 +19,15 @@ return [
'size' => [
'max' => 1024*1024*2, // 2M
],
'path_b' => '/p',
'path_a' => '/m',
'path_b' => '/upload/p',
'path_a' => '/upload/m',
],
//默认视频
'default_file' =>[
'size' => [
'max' => 1024*1024*20, // 2M
],
'path_b' => '/p',
'path_a' => '/m',
'path_b' => '/upload/p',
'path_a' => '/upload/m',
],
];
... ...