From 2800fa4f32f3900509cb4d6eefaf2bfaf54efdd7 Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Mon, 21 Apr 2025 18:29:09 +0800
Subject: [PATCH] fix: 天气显示
---
src/components/CommonWeather.vue | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/components/CommonWeather.vue b/src/components/CommonWeather.vue
index 9e260c7..223fd64 100644
--- a/src/components/CommonWeather.vue
+++ b/src/components/CommonWeather.vue
@@ -21,6 +21,8 @@
const store = useStore()
const flySuggest = computed(() => store.state.home.flySuggest)
+const selectedAreaCode = computed(() => store.state.user.selectedAreaCode)
+const useAreaCode = computed(() => store.state.user.userInfo.detail.areaCode)
const time = ref('')
const updateTime = () => {
@@ -37,8 +39,7 @@
// 获取天气建议
const getWeatherSuggest = () => {
- // ElMessage.success('wobeichonghzil')
- getDroneSuggest().then(res => {
+ getDroneSuggest({ areaCode: selectedAreaCode.value || useAreaCode.value }).then(res => {
if (res.data.code !== 0) return
weather.value = res.data.data.weather
windVelocity.value = res.data.data.windPower
--
Gitblit v1.9.3