@@ -29,28 +29,12 @@ class Upload extends AuthController{
if (empty($file)) {
return app('json')->fail("未上传文件");
}
+ $files = $request->file('files');
+ if (empty($files)) {
+ return app('json')->fail("未上传文件");
+ }
$code = $request->post("code","");
- //上传到本地
+ $codes = $request->post("codes","");
-// if($code=="invite"){
-// $sysData = (new SysModel())->where("id",1)->find();
-// $size = $file->getSize();
-// if(!empty($size) && $size>2*1024*1024){
-// return app('json')->fail("图片不能超过{$uploadConfig["image"]["size"]}M");
-// }
-//
-// $ext = $file->extension();
-// if(!in_array($ext, ["jpg","jpeg","png"])){
-// return app('json')->fail("图片类型错误");
-// $upPath = \think\facade\Filesystem::disk('resource')->putFile( $code, $file);
-// if(!$upPath){
-// return app('json')->fail("图片上传失败01");
-// $savePath = $sysData['system_url'].'/resource/' . $upPath;
-// $imgUrl = str_replace("\\", "/", $savePath);
-// return app('json')->success(['img'=>$imgUrl]);
-
$rootTmp = config('filesystem.disks.local.root') . '/' . \think\facade\Filesystem::putFile('tmp', $file);
$image_size = @getimagesize($rootTmp);
if ($image_size[0] > 1000) {
@@ -205,7 +205,7 @@ class Qiniu {
* @param type $ext 限制后缀名
* @return boolean
*/
- public function updateFile($path,$name,$files,$ext = array('jpg','png','gif','webp')) {
+ public function updateFile($path,$name,$files,$ext = array('jpg','png','gif','webp','mp3','mp4')) {
if (empty($files)) {
$this->error = '没有上传的文件!';
return false;