fix(updater): 避免因 Updater 配置不完整导致应用启动中止\n\n- Updater 插件注册改为容错(失败仅告警,不影响应用启动)
This commit is contained in:
@@ -225,8 +225,15 @@ pub fn run() {
|
||||
.setup(|app| {
|
||||
// 注册 Updater 插件(桌面端)
|
||||
#[cfg(desktop)]
|
||||
app.handle()
|
||||
.plugin(tauri_plugin_updater::Builder::new().build())?;
|
||||
{
|
||||
if let Err(e) = app
|
||||
.handle()
|
||||
.plugin(tauri_plugin_updater::Builder::new().build())
|
||||
{
|
||||
// 若配置不完整(如缺少 pubkey),跳过 Updater 而不中断应用
|
||||
log::warn!("初始化 Updater 插件失败,已跳过:{}", e);
|
||||
}
|
||||
}
|
||||
#[cfg(target_os = "macos")]
|
||||
{
|
||||
// 设置 macOS 标题栏背景色为主界面蓝色
|
||||
|
||||
@@ -42,10 +42,8 @@
|
||||
,
|
||||
"plugins": {
|
||||
"updater": {
|
||||
"pubkey": "",
|
||||
"endpoints": [
|
||||
"https://example.com/releases/latest.json"
|
||||
]
|
||||
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDRERTRCNEUxQUE3MDA4QTYKUldTbUNIQ3E0YlRrVFF2cnFVVE1jczlNZFlmemxXd0h6cTdibXRJWjBDSytQODdZOTYvR3d3d2oK",
|
||||
"endpoints":["http://127.0.0.1:8080/latest.json"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user