cqpCow 1 year ago
parent
commit
0fd3709288
1 changed files with 1 additions and 0 deletions
  1. 1 0
      app/Service/FileUploadService.php

+ 1 - 0
app/Service/FileUploadService.php

@@ -21,6 +21,7 @@ class FileUploadService extends Service
     ];
 
     public function uploadFile($file){
+        if(empty($file)) return [false, '请上传文件'];
         // 获取文件相关信息
         $ext = $file->getClientOriginalExtension();     // 扩展名
         $realPath = $file->getRealPath();   //临时文件的绝对路径