正在显示
1 个修改的文件
包含
14 行增加
和
1 行删除
| @@ -47,7 +47,20 @@ class FileController extends BaseController | @@ -47,7 +47,20 @@ class FileController extends BaseController | ||
| 47 | * @time 2023/5/29 11:42 | 47 | * @time 2023/5/29 11:42 |
| 48 | */ | 48 | */ |
| 49 | public function lists(){ | 49 | public function lists(){ |
| 50 | - $files = Upload::lists($this->param['config'] ?? 'default',['png','jpg','jpeg','gif']); | 50 | + $type = \request()->get('type'); |
| 51 | + | ||
| 52 | + switch ($type){ | ||
| 53 | + case 'video':{ | ||
| 54 | + $ext = ['mp4','avi']; | ||
| 55 | + break; | ||
| 56 | + } | ||
| 57 | + default:{ | ||
| 58 | + $ext = ['png','jpg','jpeg','gif']; | ||
| 59 | + break; | ||
| 60 | + } | ||
| 61 | + } | ||
| 62 | + | ||
| 63 | + $files = Upload::lists($this->param['config'] ?? 'default',$ext); | ||
| 51 | return $this->success($files); | 64 | return $this->success($files); |
| 52 | } | 65 | } |
| 53 | 66 |
-
请 注册 或 登录 后发表评论