Compare commits

...

3 Commits

Author SHA1 Message Date
fcec19117d Merge branch 'main' of https://gt.funmc.cn/xiaobai/FunConnect 2026-02-25 22:01:22 +08:00
13950a8d09 1 2026-02-25 22:00:35 +08:00
97e79f924a 修复错误 2026-02-25 22:00:15 +08:00
4 changed files with 5 additions and 6 deletions

View File

@@ -9,7 +9,6 @@ use quinn::{Endpoint, ServerConfig, TransportConfig};
use quinn::crypto::rustls::QuicServerConfig;
use rcgen::{CertifiedKey, generate_simple_self_signed};
use rustls::pki_types::{CertificateDer, PrivateKeyDer, PrivatePkcs8KeyDer};
use tokio::io::{AsyncReadExt, AsyncWriteExt};
use tokio::net::UdpSocket;
use tracing::{error, info, warn};
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};

View File

@@ -2,7 +2,7 @@ use axum::{
body::Body,
extract::{Path, State},
http::{header, StatusCode},
response::{Html, IntoResponse, Response},
response::{Html, Response},
Json,
};
use serde::Serialize;
@@ -70,7 +70,7 @@ pub async fn download_page(State(state): State<Arc<AppState>>) -> Html<String> {
"http://localhost:3000".to_string()
};
let html = format!(r#"<!DOCTYPE html>
let html = format!(r##"<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
@@ -187,7 +187,7 @@ pub async fn download_page(State(state): State<Arc<AppState>>) -> Html<String> {
</div>
</div>
</body>
</html>"#,
</html>"##,
server_name = config.server_name,
server_url = server_url,
version = config.client_version,

View File

@@ -43,7 +43,7 @@ pub async fn list_friends(
match rows {
Ok(friends) => {
let dtos: Vec<_> = friends.into_iter().map(|(id, username, avatar_seed, status)| {
let is_online = state.presence.is_online(id);
let is_online = state.presence.is_online(&id);
FriendDto { id, username, avatar_seed, is_online, status }
}).collect();
(StatusCode::OK, Json(serde_json::json!(dtos))).into_response()

View File

@@ -38,7 +38,7 @@ pub async fn search_users(
"id": id,
"username": username,
"avatar_seed": avatar_seed,
"is_online": state.presence.is_online(id),
"is_online": state.presence.is_online(&id),
})).collect();
(StatusCode::OK, Json(serde_json::json!(dtos))).into_response()
}