diff --git a/app.go b/app.go
index 47d112f..b3516de 100644
--- a/app.go
+++ b/app.go
@@ -144,7 +144,7 @@ func (a *App) CheckSponsorCode(sponsorCode string) map[string]any {
}
}
-func (a *App) CheckUpdate() {
+func (a *App) CheckUpdate(flag int) {
sponsorCode := strutil.Trim(a.GetConfig().SponsorCode)
if sponsorCode != "" {
encrypted, err := hex.DecodeString(sponsorCode)
@@ -296,12 +296,15 @@ func (a *App) CheckUpdate() {
})
}
} else {
- go runtime.EventsEmit(a.ctx, "newsPush", map[string]any{
- "time": "当前版本:" + Version,
- "isRed": false,
- "source": "go-stock",
- "content": "当前版本无更新",
- })
+ if flag == 1 {
+ go runtime.EventsEmit(a.ctx, "newsPush", map[string]any{
+ "time": "当前版本:" + Version,
+ "isRed": false,
+ "source": "go-stock",
+ "content": "当前版本无更新",
+ })
+ }
+
}
}
@@ -430,11 +433,11 @@ func (a *App) domReady(ctx context.Context) {
}
//检查新版本
go func() {
- a.CheckUpdate()
+ a.CheckUpdate(0)
a.CheckStockBaseInfo(a.ctx)
a.cron.AddFunc("30 05 8,12,20 * * *", func() {
logger.SugaredLogger.Errorf("Checking for updates...")
- a.CheckUpdate()
+ a.CheckUpdate(0)
})
}()
diff --git a/frontend/src/components/about.vue b/frontend/src/components/about.vue
index f00429f..ec9d6d9 100644
--- a/frontend/src/components/about.vue
+++ b/frontend/src/components/about.vue
@@ -119,7 +119,7 @@ EventsOn("updateVersion",async (msg) => {
自选股行情实时监控,基于Wails和NaiveUI构建的AI赋能股票分析工具
目前已支持A股,港股,美股,未来计划加入基金,ETF等支持
diff --git a/frontend/wailsjs/go/main/App.d.ts b/frontend/wailsjs/go/main/App.d.ts index f357823..f5bc6a7 100755 --- a/frontend/wailsjs/go/main/App.d.ts +++ b/frontend/wailsjs/go/main/App.d.ts @@ -18,7 +18,7 @@ export function CheckSponsorCode(arg1:string):Promise