From d2551a9f64e52714c707cb8f6d7bc850800fe170 Mon Sep 17 00:00:00 2001 From: owen Date: Wed, 30 Jul 2025 00:33:23 +0800 Subject: [PATCH 1/2] fix bug --- src/layer/session_layer.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/layer/session_layer.rs b/src/layer/session_layer.rs index 505d6e9..1cf5178 100644 --- a/src/layer/session_layer.rs +++ b/src/layer/session_layer.rs @@ -61,11 +61,15 @@ where fn call(&mut self, req: Request) -> Self::Future { let uri = req.uri().path(); - info!("Request URI: {}", uri); + info!("Request URI: {:?}", uri); if uri == "/toupload" { - let cookies = req.headers().get("cookie").unwrap(); - println!("the cookies:{:?}", cookies.to_str()); - let cookies = cookies.to_str().unwrap(); + let cookies = req.headers().get("cookie"); + if let None = cookies { + let response = Redirect::temporary("/tologin"); + return Box::pin(async { Ok(response.into_response()) }); + } + println!("the cookies:{:?}", cookies.unwrap().to_str()); + let cookies = cookies.unwrap().to_str().unwrap(); let should_redirect = if cookies.contains("sessionid") { let session_id = cookies .split(';') -- Gitee From cedaa8c4a9d8e6c58ec8037c1edc4d42d6e1e787 Mon Sep 17 00:00:00 2001 From: owen Date: Wed, 30 Jul 2025 09:45:21 +0800 Subject: [PATCH 2/2] change the animation duration --- templates/html/blog.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/html/blog.html b/templates/html/blog.html index be65f7c..c8f9565 100644 --- a/templates/html/blog.html +++ b/templates/html/blog.html @@ -49,7 +49,7 @@ } .move-trans-toLeft { - animation-duration: 3s; + animation-duration: 1.5s; animation-name: slidein-toLeft; } @@ -66,7 +66,7 @@ } .move-trans-toRight { - animation-duration: 3s; + animation-duration: 1.5s; animation-name: slidein-toRight; } -- Gitee