From 7b3bad4102d9a124a0067681e6f55664611cf4cf Mon Sep 17 00:00:00 2001 From: ArvinLovegood Date: Thu, 27 Feb 2025 21:23:25 +0800 Subject: [PATCH] =?UTF-8?q?feat(frontend):=E6=B7=BB=E5=8A=A0=E8=BD=AF?= =?UTF-8?q?=E4=BB=B6=E6=9B=B4=E6=96=B0=E6=A3=80=E6=9F=A5=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 about.vue 中添加检查更新按钮和相关逻辑 - 在 App.d.ts 和 App.js 中添加 CheckUpdate 函数声明 - 在 app.go 中实现 CheckUpdate 方法,检查 GitHub 上的最新版本- 更新 go.mod 中的依赖版本 --- app.go | 4 +- frontend/src/App.vue | 5 +- frontend/src/components/about.vue | 75 ++++++++++++++++++-- frontend/src/components/settings.vue | 2 +- frontend/src/components/stock.vue | 10 +-- frontend/wailsjs/go/main/App.d.ts | 2 + frontend/wailsjs/go/main/App.js | 4 ++ frontend/wailsjs/runtime/runtime.d.ts | 2 +- go.mod | 38 +++++------ go.sum | 98 +++++++++++++-------------- 10 files changed, 152 insertions(+), 88 deletions(-) diff --git a/app.go b/app.go index 7bad630..d216045 100644 --- a/app.go +++ b/app.go @@ -59,7 +59,7 @@ func (a *App) startup(ctx context.Context) { } -func checkUpdate(a *App) { +func (a *App) CheckUpdate() { releaseVersion := &models.GitHubReleaseVersion{} _, err := resty.New().R(). SetResult(releaseVersion). @@ -126,7 +126,7 @@ func (a *App) domReady(ctx context.Context) { //检查新版本 go func() { - checkUpdate(a) + a.CheckUpdate() }() //检查谷歌浏览器 diff --git a/frontend/src/App.vue b/frontend/src/App.vue index eafed34..896591e 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -1,12 +1,11 @@