$res[0]['url'], 'path' => $config['path'] . date('Ymd') . '/' . $res[0]['save_name'], 'size' => $res[0]['size'], 'mime_type' => $res[0]['mime_type'], ]; } catch (\Exception $e) { return json_fail('上传失败:' . $e->getMessage()); } return json_success('上传成功', $data); } /** * @Desc 上传图片 * @Author Gorden * @Date 2024/2/26 17:16 * * @return \support\Response */ public function image() { $config = [ 'single_limit' => 1024 * 5, 'nums' => 1, 'include' => ['jpg', 'jpeg', 'png'], 'filePath' => 'storage/images/' ]; return $this->upload($config); } /** * @Desc 上传视频 * @Author Gorden * @Date 2024/2/26 17:16 * * @return \support\Response */ public function video() { $config = [ 'single_limit' => 1024 * 1024 * 50, 'nums' => 1, 'include' => ['mp4'], 'filePath' => 'storage/videos/' ]; return $this->upload($config); } }