feat: show service mode installation prompts in user mode

This commit is contained in:
wonfen
2025-03-03 14:42:31 +08:00
parent a18efb0e71
commit 07bdc108ed
9 changed files with 161 additions and 7 deletions

View File

@@ -279,3 +279,15 @@ pub(super) async fn stop_core_by_service() -> Result<()> {
Ok(())
}
/// 检查服务是否正在运行
pub async fn is_service_running() -> Result<bool> {
let resp = check_service().await?;
// 检查服务状态码和消息
if resp.code == 200 && resp.msg == "success" && resp.data.is_some() {
Ok(true)
} else {
Ok(false)
}
}