Spaces:
Running
Running
Upload app.py
Browse files
app.py
CHANGED
|
@@ -558,6 +558,14 @@ DEFAULT_VERSION_CONFIG = {
|
|
| 558 |
}
|
| 559 |
|
| 560 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 561 |
@app.put("/api/admin/config/{config_key}")
|
| 562 |
async def set_system_config(config_key: str, value: dict, current_user: str = Depends(require_auth)):
|
| 563 |
""" 🔒 设置系统配置(仅管理员) """
|
|
|
|
| 558 |
}
|
| 559 |
|
| 560 |
|
| 561 |
+
@app.get("/api/public/project-version")
|
| 562 |
+
async def get_public_project_version():
|
| 563 |
+
"""获取项目版本信息(公开接口,无需认证)"""
|
| 564 |
+
config = _load_system_config()
|
| 565 |
+
version_data = config.get("project_version", DEFAULT_VERSION_CONFIG)
|
| 566 |
+
return {"status": "success", "data": version_data}
|
| 567 |
+
|
| 568 |
+
|
| 569 |
@app.put("/api/admin/config/{config_key}")
|
| 570 |
async def set_system_config(config_key: str, value: dict, current_user: str = Depends(require_auth)):
|
| 571 |
""" 🔒 设置系统配置(仅管理员) """
|