diff --git a/application/admin/controller/api/Plugs.php b/application/admin/controller/api/Plugs.php index 8e32886cf..99444c463 100644 --- a/application/admin/controller/api/Plugs.php +++ b/application/admin/controller/api/Plugs.php @@ -37,6 +37,24 @@ class Plugs extends Controller $this->fetch(); } + /** + * 获取文件上传参数 + * @throws \think\Exception + * @throws \think\exception\PDOException + */ + public function check() + { + $diff1 = explode(',', strtolower(input('exts'))); + $diff2 = explode(',', strtolower(sysconf('storage_local_exts'))); + $exts = array_intersect($diff1, $diff2); + $this->success('获取文件上传参数', [ + 'exts' => join('|', $exts), + 'mime' => File::mine($exts), + 'type' => $this->getUploadType(), + 'data' => $this->getUploadData(), + ]); + } + /** * 后台通用文件上传 * @return \think\response\Json @@ -69,24 +87,6 @@ class Plugs extends Controller } } - /** - * 获取文件上传参数 - * @throws \think\Exception - * @throws \think\exception\PDOException - */ - public function check() - { - $diff1 = explode(',', strtolower(input('exts'))); - $diff2 = explode(',', strtolower(sysconf('storage_local_exts'))); - $exts = array_intersect($diff1, $diff2); - $this->success('获取文件上传参数', [ - 'exts' => join('|', $exts), - 'mime' => File::mine($exts), - 'type' => $this->getUploadType(), - 'data' => $this->getUploadData(), - ]); - } - /** * 生成文件上传参数 * @return array