From d48a1cf88b654575dd2c9bf7158f66a72c0e9d33 Mon Sep 17 00:00:00 2001 From: XiuChengWu <732857315@qq.com> Date: Tue, 31 Mar 2026 23:22:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BD=BF=E7=94=A8=20CARGO=5FPKG=5FVERSI?= =?UTF-8?q?ON=20=E6=9B=BF=E6=8D=A2=E7=A1=AC=E7=BC=96=E7=A0=81=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - routes.rs: AppInfoResponse.version 使用 env!(CARGO_PKG_VERSION) - device/mod.rs: DevicePlugin PluginInfo.version 使用 env!(CARGO_PKG_VERSION) 消除版本不一致问题:之前 Cargo.toml 版本为 0.2.0,但代码中硬编码为 0.1.0。 --- src/plugins/device/mod.rs | 2 +- src/plugins/http/routes.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/device/mod.rs b/src/plugins/device/mod.rs index 972f0ea..e85b08e 100644 --- a/src/plugins/device/mod.rs +++ b/src/plugins/device/mod.rs @@ -87,7 +87,7 @@ impl Plugin for DevicePlugin { fn info(&self) -> PluginInfo { PluginInfo { name: "Device Manager".to_string(), - version: "0.1.0".to_string(), + version: env!("CARGO_PKG_VERSION").to_string(), description: format!("统一设备管理插件 ({})", self.backend.name()), platform: Platform::Any, } diff --git a/src/plugins/http/routes.rs b/src/plugins/http/routes.rs index 3aeaed3..6f9b73c 100644 --- a/src/plugins/http/routes.rs +++ b/src/plugins/http/routes.rs @@ -526,7 +526,7 @@ fn app_info_route( Ok::<_, Infallible>(json_response( StatusCode::OK, &AppInfoResponse { - version: "0.1.0".to_string(), + version: env!("CARGO_PKG_VERSION").to_string(), apk_available: apk_size.is_some(), apk_size, download_url: "/download/showen-app.apk",