setLog(self::TYPENAME. '图片开始', $this->startTime()); $picInfo = getimagesize($file); if (! $picInfo) { $this->error()->notImageFile(); } $srcPath = $file->getPathname(); $extension = $file->getClientOriginalExtension(); $fileName = time() . rand() . '.' . $extension; $dstPath = $dst . '/' . date('Y') . '/' . date('m'); $size = $file->getSize(); $path = Storage::putFile($dstPath, $file); $this->setLog(self::TYPENAME. '图片结束', $this->startTime, [$path]); return $this->response($path); } }