From 1a3c8b4faea4bf8f12d6fd5caff6021ca6227fa7 Mon Sep 17 00:00:00 2001 From: ArvinLovegood Date: Mon, 7 Apr 2025 14:03:17 +0800 Subject: [PATCH] =?UTF-8?q?feat(config):=E6=B7=BB=E5=8A=A0=E5=9F=BA?= =?UTF-8?q?=E9=87=91=E5=8A=9F=E8=83=BD=E5=90=AF=E7=94=A8=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在配置文件中增加 enableFund 字段,用于控制是否启用基金功能 - 根据配置决定是否启动基金监控和数据获取任务 - 更新前端界面,在设置页面添加基金功能启用开关 - 优化代码结构,提高可维护性和可读性 --- frontend/src/App.vue | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/frontend/src/App.vue b/frontend/src/App.vue index b3113bf..f213a05 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -21,6 +21,7 @@ import {GetConfig} from "../wailsjs/go/main/App"; const enableNews= ref(false) const contentStyle = ref("") const enableFund = ref(false) +const enableDarkTheme = ref(null) const content = ref('数据来源于网络,仅供参考;投资有风险,入市需谨慎') const isFullscreen = ref(false) const activeKey = ref('') @@ -200,6 +201,18 @@ onBeforeMount(()=>{ GetConfig().then((res)=>{ console.log(res) enableFund.value=res.enableFund + + menuOptions.value.filter((item)=>{ + if(item.key==='fund'){ + item.show=res.enableFund + } + }) + + if(res.darkTheme){ + enableDarkTheme.value=darkTheme + }else{ + enableDarkTheme.value=null + } }) }) @@ -209,6 +222,7 @@ onMounted(()=>{ if(res.enableNews){ enableNews.value=true } + enableFund.value=res.enableFund }) })