fix: 使用 CARGO_PKG_VERSION 替换硬编码版本号
- 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。
This commit is contained in:
@@ -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,
|
||||
}
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user