[ 'rules' => [ 'file' => 'required', 'file_type' => 'required' ] ] ]; public function upload(Request $request) { $file = $request->file('file'); $fileType = $request->input('file_type','files'); $disk = Storage::disk('oss'); $filename = $disk->putFile($fileType."/".date('Ymd'), $file); $url = str_replace('http://bmoc-files.oss-cn-hangzhou.aliyuncs.com', 'http://images.banmacar.com', $disk->getUrl($filename)); return $this->success(['url' => $url]); } }