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) => { vip到期时间:{{vipEndTime}} - 检查更新 + 检查更新

自选股行情实时监控,基于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>; export function CheckStockBaseInfo(arg1:context.Context):Promise; -export function CheckUpdate():Promise; +export function CheckUpdate(arg1:number):Promise; export function ClsCalendar():Promise>; diff --git a/frontend/wailsjs/go/main/App.js b/frontend/wailsjs/go/main/App.js index 00aa96a..bf3a42e 100755 --- a/frontend/wailsjs/go/main/App.js +++ b/frontend/wailsjs/go/main/App.js @@ -30,8 +30,8 @@ export function CheckStockBaseInfo(arg1) { return window['go']['main']['App']['CheckStockBaseInfo'](arg1); } -export function CheckUpdate() { - return window['go']['main']['App']['CheckUpdate'](); +export function CheckUpdate(arg1) { + return window['go']['main']['App']['CheckUpdate'](arg1); } export function ClsCalendar() {