添加了正确的katex方法

This commit is contained in:
2025-10-17 15:50:59 +08:00
parent 5e5d6c4c76
commit 7d4f27feff
91 changed files with 49174 additions and 8 deletions

View File

@@ -570,7 +570,7 @@ async fn serve_static_files(path: web::Path<String>) -> impl Responder {
let file_path = path.into_inner();
// 【调试日志 1】打印服务器收到的文件路径
info!("请求静态文件: {}", file_path);
debug!("请求静态文件: {}", file_path);
// 从嵌入的 STATIC_DIR 中查找文件
match STATIC_DIR.get_file(&file_path) {
@@ -586,7 +586,10 @@ async fn serve_static_files(path: web::Path<String>) -> impl Responder {
_ => "application/octet-stream", // 默认类型
};
info!("成功找到文件: {}, Content-Type: {}", file_path, content_type);
debug!(
"成功找到文件: {}, Content-Type: {}",
file_path, content_type
);
HttpResponse::Ok()
.content_type(content_type)
.body(file.contents())
@@ -594,7 +597,7 @@ async fn serve_static_files(path: web::Path<String>) -> impl Responder {
None => {
// 文件不存在时返回 404
// 【调试日志 3】打印文件未找到的信息
info!("文件未找到: {}", file_path);
error!("文件未找到: {}", file_path);
HttpResponse::NotFound().body("静态文件不存在")
}
}