diff --git a/src-tauri/src/core/updater.rs b/src-tauri/src/core/updater.rs index 21a90549c..aa39e1ab2 100644 --- a/src-tauri/src/core/updater.rs +++ b/src-tauri/src/core/updater.rs @@ -252,15 +252,27 @@ impl SilentUpdater { true } Ok(Ok(Err(e))) => { - logging!(warn, Type::System, "Startup install failed: {e}, will retry next launch"); + logging!( + warn, + Type::System, + "Startup install failed: {e}, will retry next launch" + ); false } Ok(Err(e)) => { - logging!(warn, Type::System, "Startup install task panicked: {e}, will retry next launch"); + logging!( + warn, + Type::System, + "Startup install task panicked: {e}, will retry next launch" + ); false } Err(_) => { - logging!(warn, Type::System, "Startup install timed out (30s), will retry next launch"); + logging!( + warn, + Type::System, + "Startup install timed out (30s), will retry next launch" + ); false } }; @@ -283,8 +295,7 @@ impl SilentUpdater { use tauri_plugin_dialog::{DialogExt as _, MessageDialogButtons, MessageDialogKind}; let title = clash_verge_i18n::t!("notifications.updateReady.title").to_string(); - let body = clash_verge_i18n::t!("notifications.updateReady.body") - .replace("{version}", version); + let body = clash_verge_i18n::t!("notifications.updateReady.body").replace("{version}", version); let install_now = clash_verge_i18n::t!("notifications.updateReady.installNow").to_string(); let later = clash_verge_i18n::t!("notifications.updateReady.later").to_string(); diff --git a/src/components/profile/groups-editor-viewer.tsx b/src/components/profile/groups-editor-viewer.tsx index 2606da8eb..2152bc5fa 100644 --- a/src/components/profile/groups-editor-viewer.tsx +++ b/src/components/profile/groups-editor-viewer.tsx @@ -614,7 +614,7 @@ export const GroupsEditorViewer = (props: Props) => { /> { delayManager.setUrl(groupName, testUrl?.trim() || url || defaultLatencyUrl) diff --git a/src/components/setting/mods/misc-viewer.tsx b/src/components/setting/mods/misc-viewer.tsx index 03f5ed5e9..91247c877 100644 --- a/src/components/setting/mods/misc-viewer.tsx +++ b/src/components/setting/mods/misc-viewer.tsx @@ -383,7 +383,7 @@ export const MiscViewer = forwardRef((props, ref) => { spellCheck="false" sx={{ width: 250, marginLeft: 'auto' }} value={values.defaultLatencyTest} - placeholder="http://cp.cloudflare.com" + placeholder="http://cp.cloudflare.com/generate_204" onChange={(e) => setValues((v) => ({ ...v, defaultLatencyTest: e.target.value })) } diff --git a/src/services/cmds.ts b/src/services/cmds.ts index 2715fa81a..3d3a447bc 100644 --- a/src/services/cmds.ts +++ b/src/services/cmds.ts @@ -340,7 +340,7 @@ export async function cmdGetProxyDelay( url?: string, ) { // 确保URL不为空 - const testUrl = url || 'http://cp.cloudflare.com' + const testUrl = url || 'http://cp.cloudflare.com/generate_204' try { // 不再在前端编码代理名称,由后端统一处理编码 diff --git a/src/services/delay.ts b/src/services/delay.ts index faab3b06e..9f5246f0c 100644 --- a/src/services/delay.ts +++ b/src/services/delay.ts @@ -120,7 +120,7 @@ class DelayManager { `[DelayManager] 获取测试URL,组: ${group}, URL: ${url || '未设置'}`, ) // 如果未设置URL,返回默认URL - return url || 'http://cp.cloudflare.com' + return url || 'http://cp.cloudflare.com/generate_204' } setListener(