feat: 添加 App 检查更新功能
- 前端:设置页面添加检查更新菜单项,从 pubspec.yaml 动态获取版本号 - 后端:新增 /api/v1/app/check-updates 接口,自动扫描 releases 目录对比版本 - 配置:新增 AppVersionSettings,支持通过环境变量配置版本和下载链接 - Docker:添加 releases 目录挂载
This commit is contained in:
@@ -198,6 +198,25 @@ class DatabaseSettings(BaseModel):
|
||||
)
|
||||
|
||||
|
||||
class AppVersionSettings(BaseModel):
|
||||
releases_dir: str = Field(
|
||||
default="releases",
|
||||
description="安装包目录,相对于项目根目录",
|
||||
)
|
||||
current_version: str = Field(
|
||||
default="0.1.0",
|
||||
description="当前版本号",
|
||||
)
|
||||
current_build: int = Field(
|
||||
default=1,
|
||||
description="当前构建号",
|
||||
)
|
||||
download_base_url: str = Field(
|
||||
default="",
|
||||
description="下载链接基础域名,如 https://your-domain.com",
|
||||
)
|
||||
|
||||
|
||||
def _resolve_env_file() -> str:
|
||||
current = Path(__file__).resolve()
|
||||
for parent in [current, *current.parents]:
|
||||
@@ -221,6 +240,7 @@ class Settings(BaseSettings):
|
||||
agent_runtime: AgentRuntimeSettings = AgentRuntimeSettings()
|
||||
taskiq: TaskiqSettings = TaskiqSettings()
|
||||
database: DatabaseSettings = DatabaseSettings()
|
||||
app_version: AppVersionSettings = AppVersionSettings()
|
||||
|
||||
@computed_field
|
||||
@property
|
||||
|
||||
Reference in New Issue
Block a user