diff --git a/service/app/admin/controller/UploadController.php b/service/app/admin/controller/UploadController.php index 5e88b520..903d98ce 100644 --- a/service/app/admin/controller/UploadController.php +++ b/service/app/admin/controller/UploadController.php @@ -26,14 +26,14 @@ class UploadController extends base $now = date_create(); $savepath = sprintf("/uploads/%d/%s/%s", $request->admin->id, $now->format("YmdHisu"), $file->getUploadName()); - $file->move(public_path(). $savepath); - $item = new Uploads(); $item->admin_id = $request->admin->id; $item->filesize = $file->getSize(); $item->filepath = $savepath; $item->mime = $file->getUploadMimeType(); $item->create_at = $now->getTimestamp(); + + $file->move(public_path(). $savepath); $item->save(); return $this->success($savepath);