diff --git a/src/config.rs b/src/config.rs index e6c2dce..901c0d4 100644 --- a/src/config.rs +++ b/src/config.rs @@ -14,7 +14,6 @@ pub struct AppConfig { pub ssl_key_path: String, pub ssl_cert_path: String, pub rust_log: String, - pub app_version: String, pub environment: String, pub free_user_data_limit: i32, pub server_host: String, @@ -82,11 +81,7 @@ impl AppConfig { let app_config: AppConfig = toml::from_str(&settings.to_string()) .map_err(|e| format!("配置反序列化失败: {}", e))?; - tracing::info!( - "配置加载成功,环境={},app_version={}", - app_config.environment, - app_config.app_version - ); + tracing::info!("配置加载成功,环境={}", app_config.environment); Ok(app_config) } diff --git a/src/main.rs b/src/main.rs index 7196127..1c38d5c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -112,7 +112,6 @@ async fn main() -> std::io::Result<()> { std::env::set_var("SSL_CERT_PATH", &app_config.ssl_cert_path); std::env::set_var("RUST_LOG", &app_config.rust_log); std::env::set_var("FREE_USER_DATA_LIMIT", app_config.free_user_data_limit.to_string()); - std::env::set_var("APP_VERSION", &app_config.app_version); } // 初始化文件日志(JSON 格式,带轮转) diff --git a/src/models.rs b/src/models.rs index a6b6920..bc01c88 100644 --- a/src/models.rs +++ b/src/models.rs @@ -337,7 +337,6 @@ pub struct AppState { pub wechat_appid: String, pub wechat_secret: String, pub free_user_data_limit: i32, - pub app_version: String, } impl AppState { @@ -352,8 +351,6 @@ impl AppState { free_user_data_limit: std::env::var("FREE_USER_DATA_LIMIT") .map(|v| v.parse().unwrap_or(20)) .unwrap_or(20), - app_version: std::env::var("APP_VERSION") - .unwrap_or_else(|_| "unknown".to_string()), }) } }