diff --git a/services/web_panel/routes/status.py b/services/web_panel/routes/status.py index a374ea3..16fd2e5 100644 --- a/services/web_panel/routes/status.py +++ b/services/web_panel/routes/status.py @@ -49,14 +49,14 @@ def setup_routes(app, prefix=''): logger.info(f"📡 系统状态WS端点已注册: {prefix}/api/system/ws (已加认证)") def _read_version(): - """Read version from config file (shared helper)""" - ver = "v0.6.0" + """Read version from version.json (shared helper)""" + ver = "v0.0.0" try: - import yaml, os - config_path = os.path.join(os.path.dirname(__file__), "..", "..", "..", "config", "framework", "base_config.yaml") - with open(config_path) as f: - cfg = yaml.safe_load(f) - ver = cfg.get("framework", {}).get("version", ver) + import json, os + vf = os.path.join(os.path.dirname(__file__), "..", "..", "..", "version.json") + with open(vf) as f: + data = json.load(f) + ver = data.get("framework", {}).get("version", ver) except: pass return ver @@ -193,7 +193,7 @@ async def create_backup(req): if sm: try: init = sm.get_service("init") - ver = init.get_config("base").get("framework", {}).get("version", "0.0.0") + ver = _read_version() except: pass name = f"SenSu_backup_{ver}_{_time.strftime('%Y%m%d_%H%M%S')}.zip" dest = _os.path.join(backup_dir, name)