From 93020a8e1481e8a806eb10d362bdf7c062acfddd Mon Sep 17 00:00:00 2001 From: xfy Date: Fri, 5 Jun 2026 15:00:29 +0800 Subject: [PATCH] fix(upload): remove space in filename format and unused UploadResponse struct --- src/api/upload.rs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/api/upload.rs b/src/api/upload.rs index 558714c..aaaa302 100644 --- a/src/api/upload.rs +++ b/src/api/upload.rs @@ -13,13 +13,6 @@ use crate::auth::session::parse_session_token; const ALLOWED_MIME_TYPES: &[&str] = &["image/jpeg", "image/png", "image/gif", "image/webp"]; const MAX_FILE_SIZE: usize = 5 * 1024 * 1024; // 5MB -#[derive(Debug, Clone, serde::Serialize)] -struct UploadResponse { - success: bool, - url: Option, - error: Option, -} - #[cfg(feature = "server")] pub async fn upload_image( headers: HeaderMap, @@ -145,7 +138,7 @@ pub async fn upload_image( }; let dir_path = format!("uploads/{}/{}/{}", year, month, day); - let file_name = format!("{}.{}. {}", now.format("%H%M%S"), uuid, ext); + let file_name = format!("{}.{ }.{}", now.format("%H%M%S"), uuid, ext); let file_path = format!("{}/{}", dir_path, file_name); let url_path = format!("/uploads/{}/{}/{}/{}", year, month, day, file_name);