修复: 粘贴图失效与SFTP串台回退等一批问题
粘贴图根修(Ctrl+V直读系统剪贴板,不再依赖不可靠的paste事件)/SFTP串台双刀(拨号期禁回退本机+盘符路径自动回根)/PDF导出目录设置与文案带落盘路径/性能批(连接保存下载防重/md渲染防抖+预热/hljs按需加载/审计锁外置/快捷方式解析超时/webview-watch可停)/前端62类型错清零(含keyPath蛇形字段炸弹)/目录图标字段错位修复
This commit is contained in:
@@ -13,6 +13,7 @@ import (
|
||||
"golang.org/x/sync/errgroup"
|
||||
|
||||
"u-desk/internal/api"
|
||||
"u-desk/internal/common"
|
||||
"u-desk/internal/filewatch"
|
||||
"u-desk/internal/filesystem"
|
||||
"u-desk/internal/hotkey"
|
||||
@@ -134,7 +135,7 @@ func (a *App) ServiceStartup(ctx context.Context, _ application.ServiceOptions)
|
||||
slog.Info("可用的模块", "modules", visibleTabs)
|
||||
|
||||
// 非关键路径并行初始化(PdfAPI/Filesystem/Cleanup 不阻塞首屏渲染)
|
||||
go func() {
|
||||
common.Go("init-modules", func() {
|
||||
// 2.6. 初始化PDF导出API
|
||||
slog.Info("初始化PDF导出模块")
|
||||
if pdfAPI, err := api.NewPdfAPI(); err != nil {
|
||||
@@ -154,10 +155,10 @@ func (a *App) ServiceStartup(ctx context.Context, _ application.ServiceOptions)
|
||||
// 清理过期的下载缓存
|
||||
storage.CleanupExpiredCache()
|
||||
storage.CleanupSiteCacheDirs()
|
||||
}()
|
||||
})
|
||||
|
||||
// 6. 异步初始化:UpdateAPI(涉及网络请求,完全异步)
|
||||
go func() {
|
||||
common.Go("init-update-api", func() {
|
||||
checkURL := "https://c.1216.top/last-version.json"
|
||||
if cfg, err := service.LoadUpdateConfig(); err == nil && cfg.CheckURL != "" {
|
||||
checkURL = cfg.CheckURL
|
||||
@@ -176,12 +177,12 @@ func (a *App) ServiceStartup(ctx context.Context, _ application.ServiceOptions)
|
||||
a.updateAPI.SetConfigChangedCallback(a.resetAutoUpdateCheck)
|
||||
a.startAutoUpdateCheck()
|
||||
}
|
||||
}()
|
||||
})
|
||||
|
||||
// 延迟注册全局热键(轮询等待原生窗口创建完成)
|
||||
// RegisterHotKey 必须在创建窗口的同一线程调用,
|
||||
// 通过 PostMessage 将注册请求投递到主线程消息循环
|
||||
go func() {
|
||||
common.Go("register-hotkey", func() {
|
||||
delays := []time.Duration{50 * time.Millisecond, 100 * time.Millisecond, 200 * time.Millisecond}
|
||||
for i := 0; i < 15; i++ {
|
||||
time.Sleep(delays[min(i, len(delays)-1)])
|
||||
@@ -195,7 +196,7 @@ func (a *App) ServiceStartup(ctx context.Context, _ application.ServiceOptions)
|
||||
}
|
||||
}
|
||||
slog.Warn("等待窗口超时")
|
||||
}()
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user