diff --git a/app.go b/app.go
index d447eb0..b3192c3 100644
--- a/app.go
+++ b/app.go
@@ -139,6 +139,22 @@ func (a *App) CheckUpdate() {
func (a *App) domReady(ctx context.Context) {
defer PanicHandler()
+ if stocksBin != nil && len(stocksBin) > 0 {
+ go runtime.EventsEmit(a.ctx, "loadingMsg", "检查A股基础信息...")
+ go initStockData(a.ctx)
+ }
+
+ if stocksBinHK != nil && len(stocksBinHK) > 0 {
+ go runtime.EventsEmit(a.ctx, "loadingMsg", "检查港股基础信息...")
+ go initStockDataHK(a.ctx)
+ }
+
+ if stocksBinUS != nil && len(stocksBinUS) > 0 {
+ go runtime.EventsEmit(a.ctx, "loadingMsg", "检查美股基础信息...")
+ go initStockDataUS(a.ctx)
+ }
+ updateBasicInfo()
+
// Add your action here
//定时更新数据
config := data.NewSettingsApi(&data.Settings{}).GetConfig()
diff --git a/backend/data/openai_api.go b/backend/data/openai_api.go
index 56529c2..93d5ee8 100644
--- a/backend/data/openai_api.go
+++ b/backend/data/openai_api.go
@@ -849,6 +849,6 @@ func (o OpenAi) SaveAIResponseResult(stockCode, stockName, result, chatId, quest
func (o OpenAi) GetAIResponseResult(stock string) *models.AIResponseResult {
var result models.AIResponseResult
- db.Dao.Where("stock_code = ?", stock).Order("id desc").Limit(1).First(&result)
+ db.Dao.Where("stock_code = ?", stock).Order("id desc").Limit(1).Find(&result)
return &result
}
diff --git a/frontend/src/App.vue b/frontend/src/App.vue
index 4795a4f..1a5338c 100644
--- a/frontend/src/App.vue
+++ b/frontend/src/App.vue
@@ -1,45 +1,48 @@
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
- {{item}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ {{ loadingMsg }}
+
+
+
+ {{ item }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/frontend/src/components/market.vue b/frontend/src/components/market.vue
index 403c367..ee8e6f2 100644
--- a/frontend/src/components/market.vue
+++ b/frontend/src/components/market.vue
@@ -53,6 +53,9 @@ const industryRanks=ref([])
const sort = ref("")
const sortIcon= ref(h(CaretDown))
const nowTab=ref("市场快讯")
+const indexInterval= ref(null)
+const indexIndustryRank= ref(null)
+
function getIndex() {
GlobalStockIndexes().then((res) => {
globalStockIndexes.value = res
@@ -84,11 +87,11 @@ onBeforeMount(() => {
})
getIndex();
industryRank();
- setInterval(() => {
+ indexInterval.value=setInterval(() => {
getIndex()
}, 3000)
- setInterval(() => {
+ indexIndustryRank.value=setInterval(() => {
industryRank()
},1000*10)
})
@@ -98,6 +101,8 @@ onBeforeUnmount(() => {
EventsOff("newTelegraph")
EventsOff("newSinaNews")
EventsOff("summaryStockNews")
+ clearInterval(indexInterval.value)
+ clearInterval(indexIndustryRank.value)
})
EventsOn("changeMarketTab" ,async (msg) => {
diff --git a/frontend/src/components/rankTable.vue b/frontend/src/components/rankTable.vue
index edaf01f..0968b2b 100644
--- a/frontend/src/components/rankTable.vue
+++ b/frontend/src/components/rankTable.vue
@@ -1,8 +1,8 @@