|
|
|
@ -41,18 +41,6 @@ class UploadService extends BaseAdminService |
|
|
|
return $core_upload_service->image($file, $dir, $cate_id); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 附件库上传视频 |
|
|
|
* @param $file |
|
|
|
* @param int $cate_id |
|
|
|
* @return array |
|
|
|
*/ |
|
|
|
public function video($file, int $cate_id = 0){ |
|
|
|
$dir = $this->root_path.'/video/'.date('Ym').'/'.date('d'); |
|
|
|
$core_upload_service = new CoreUploadService(true); |
|
|
|
return $core_upload_service->video($file, $dir, $cate_id); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 文件上传 |
|
|
|
* @param $file |
|
|
|
@ -61,10 +49,30 @@ class UploadService extends BaseAdminService |
|
|
|
* @throws Exception |
|
|
|
*/ |
|
|
|
public function document($file, string $type){ |
|
|
|
|
|
|
|
// if(!in_array($type, FileDict::getSceneType())) |
|
|
|
// throw new UploadFileException('UPLOAD_TYPE_ERROR'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$dir = $this->root_path.'/document/'.$type.'/'.date('Ym').'/'.date('d'); |
|
|
|
|
|
|
|
// $dir = $this->root_path.'/document/'.$type.'/'.$name[0]; |
|
|
|
$core_upload_service = new CoreUploadService(); |
|
|
|
return $core_upload_service->document($file, $type, $dir, StorageDict::LOCAL); |
|
|
|
return $core_upload_service->document($file, $type, $dir, StorageDict::TENCENT); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 附件库上传视频 |
|
|
|
* @param $file |
|
|
|
* @param int $cate_id |
|
|
|
* @return array |
|
|
|
*/ |
|
|
|
public function video($file, int $cate_id = 0){ |
|
|
|
$dir = $this->root_path.'/video/'.date('Ym').'/'.date('d'); |
|
|
|
$core_upload_service = new CoreUploadService(true); |
|
|
|
return $core_upload_service->video($file, $dir, $cate_id); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|