From c0898b5f6fa4ad2036b4c24eeb308483db3e0231 Mon Sep 17 00:00:00 2001 From: JSR Date: Sun, 5 Jul 2026 20:22:14 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E4=B8=BA=20OAuth=20=E5=9B=9E=E8=B0=83?= =?UTF-8?q?=E9=93=BE=E8=B7=AF=E6=B7=BB=E5=8A=A0=E5=A2=99=E9=92=9F=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 定位 19s 延迟:Rust 命令本体 0ms 完成,延迟在 Tauri IPC 往返。 前后端各步骤加 wall= 时间戳,便于比对 invoke 投递 vs 结果返回耗时。 Co-Authored-By: Claude --- src-tauri/src/commands/oauth_server.rs | 5 +++-- src/components/OAuth/OAuthLogin.tsx | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src-tauri/src/commands/oauth_server.rs b/src-tauri/src/commands/oauth_server.rs index 1914094..f44e271 100644 --- a/src-tauri/src/commands/oauth_server.rs +++ b/src-tauri/src/commands/oauth_server.rs @@ -40,9 +40,10 @@ pub async fn oauth_start_callback_server( let t0 = std::time::Instant::now(); let log = |step: &str| { println!( - "[OAuth Callback] {} +{}ms", + "[OAuth Callback] {} +{}ms (wall={})", step, - t0.elapsed().as_millis() + t0.elapsed().as_millis(), + chrono::Local::now().format("%H:%M:%S%.3f") ); }; log("oauth_start_callback_server enter"); diff --git a/src/components/OAuth/OAuthLogin.tsx b/src/components/OAuth/OAuthLogin.tsx index d25d271..fc4cadb 100644 --- a/src/components/OAuth/OAuthLogin.tsx +++ b/src/components/OAuth/OAuthLogin.tsx @@ -129,7 +129,9 @@ export function OAuthLogin({ visible, onClose, onSuccess }: OAuthLoginProps) { setLoading(true) const t0 = performance.now() const log = (step: string) => - console.log(`[OAuthLogin] ${step} +${Math.round(performance.now() - t0)}ms`) + console.log( + `[OAuthLogin] ${step} +${Math.round(performance.now() - t0)}ms (wall=${new Date().toISOString()})` + ) log("handleOAuthLogin start") try {