修改了部分代码位置

This commit is contained in:
2025-10-17 16:30:24 +08:00
parent 8cc5c6d0ed
commit e294c00c0b

View File

@@ -1,5 +1,3 @@
use std::pin::Pin;
use actix_web::middleware::from_fn;
use actix_web::{App, HttpResponse, HttpServer, Responder, delete, get, post, web};
use include_dir::{Dir, include_dir};
@@ -7,6 +5,7 @@ use log::{debug, error, info, warn};
use openssl::ssl::{SslAcceptor, SslAcceptorBuilder, SslFiletype, SslMethod};
use reqwest::Client;
use sqlx::postgres::PgPool;
use std::pin::Pin;
mod auth;
mod db;
mod models;
@@ -577,6 +576,7 @@ async fn serve_static_files(path: web::Path<String>) -> impl Responder {
Some(file) => {
// 根据文件扩展名设置 Content-Type
let content_type = match file_path.split('.').last() {
Some("ico") => "image/x-icon",
Some("css") => "text/css",
Some("js") => "application/javascript",
Some("html") => "text/html",