uploadAvatarImage(); if (!$file) { return $this->jsonError(['msg' => '上传文件失败']); } $data = [ 'id' => $file->id, 'name' => $file->name, 'url' => $service->getImageUrl($file->path), ]; return $this->jsonSuccess(['data' => $data]); } }