diff --git a/src/views/home/modules/header-banner.vue b/src/views/home/modules/header-banner.vue index f3f75df..2ad78e5 100644 --- a/src/views/home/modules/header-banner.vue +++ b/src/views/home/modules/header-banner.vue @@ -5,7 +5,7 @@ import { useAppStore } from '@/store/modules/app'; import type { ECOption } from '@/hooks/common/echarts'; import { useI18n } from 'vue-i18n'; import { useAuthStore } from '@/store/modules/auth'; -import { clientAuth } from '@/service/ue/client'; + const { t } = useI18n(); const authStore = useAuthStore(); @@ -257,27 +257,6 @@ const updateGaugeData = (opts: ECOption, data: GaugeDisplayData, progressRatio?: // 添加峰值速率的 ref const peakTrafficRate = ref(0); -// 添加检查是否可以上网的函数 -function checkAndTriggerAuth(dashboardData: any) { - // 检查是否有余额 - const hasBalance = dashboardData.balance > 0; - - // 检查是否不限制流量 - const noTrafficLimit = !dashboardData.trafficEnable; - - // 检查是否有剩余流量 - const hasRemainingTraffic = dashboardData.trafficEnable && - (dashboardData.traffic - dashboardData.trafficUsed) > 0; - - // 如果满足任一条件,触发上网 - if (hasBalance || noTrafficLimit || hasRemainingTraffic) { - clientAuth().then((res) => { - console.log('Auto auth triggered:', res); - }).catch(err => { - console.error('Auto auth failed:', err); - }); - } -} // 修改 mockDataUpdate 函数,在获取数据后添加检查 async function mockDataUpdate() { @@ -350,9 +329,6 @@ async function mockDataUpdate() { subTitle: t('page.headerbanner.maxspeed') + `: ${peakSpeed.value}${peakSpeed.unit}` }; - // 在数据处理完成后,添加自动上网检查 - checkAndTriggerAuth(response); - // 统一更新所有图表 updateGauge1(opts => updateGaugeData(opts, baseData.value[0])); updateGauge2(opts => {