$file = request()->file(''); if(!empty($file)){ $info = $file['pphoto']->validate([ 'size' => 1567800000, 'ext' => 'jpg,png,gif,jpeg', ])->move('uploads'); if ($info) { $newData['pphoto'] = "uploads\\" . $info->getSaveName(); } else { _alert_back($file->getError()); } } 需要这样写 $info = $file['pphoto'] 才不会报 文件未上传