فهرست منبع

右侧获取天气接口转直连

JX.LI 1 سال پیش
والد
کامیت
7bc0c4de87
2فایلهای تغییر یافته به همراه14 افزوده شده و 14 حذف شده
  1. 1 1
      src/api/forest.js
  2. 13 13
      src/views/forest.vue

+ 1 - 1
src/api/forest.js

@@ -121,7 +121,7 @@ export function getExposureStage(param) {
 // 右侧获取天气
 export function getWeather(param) {
   return request({
-    url: '/center-traffic/traffic/getWeather',
+    url: '/center-data/weatherinformation/getWeather',
     method: 'post',
     data: param
   })

+ 13 - 13
src/views/forest.vue

@@ -429,7 +429,7 @@
     getEventPush,
     getLatestNotice,
     getTodayEvents,
-   
+
     getWeather,
     selectByMenuId,
     getEventList,
@@ -522,7 +522,7 @@
       setTimeout(() => {
         this.getResourcesCount();
         this.getTodayEvents(this.getCurrentDataStr())
-       
+
         this.getWeather(this.getCurrentDataStr())
         this.getEventList(this.getCurrentDataStr(), this.pageSize, this.pageNum)
         this.getEventByEventType(this.getCurrentDataStr())
@@ -1124,7 +1124,7 @@
       selectDay(day) { //日历点击
         this.pageNum = 1
         this.getTodayEvents(day)
-      
+
         this.getWeather(day)
         this.getEventList(day, 10, 1)
         this.getEventByEventType(day)
@@ -1357,19 +1357,19 @@
           day: day
         }).then(res => {
           if (res.code == 200) {
-            if (res.msg == '天气未添加') {
+            if (res.data.length == 0) {
               this.todatWeather = false
             } else {
               this.todatWeather = true
-              this.weatherinformationDirection = res.data.weatherinformationDirection
-              this.weatherinformationHigh = res.data.weatherinformationHigh
-              this.weatherinformationLevel = res.data.weatherinformationLevel
-              this.weatherinformationLevelValue = res.data.weatherinformationLevelValue
-              this.weatherinformationLow = res.data.weatherinformationLow
-              this.weatherinformationPower = res.data.weatherinformationPower
-              this.weatherinformationTemperature = res.data.weatherinformationTemperature
-              this.weatherinformationTime = res.data.weatherinformationTime
-              this.weatherinformationWeather = res.data.weatherinformationWeather
+              this.weatherinformationDirection = res.data[0].weatherinformationDirection
+              this.weatherinformationHigh = res.data[0].weatherinformationHigh
+              this.weatherinformationLevel = res.data[0].weatherinformationLevel
+              this.weatherinformationLevelValue = res.data[0].weatherinformationLevelValue
+              this.weatherinformationLow = res.data[0].weatherinformationLow
+              this.weatherinformationPower = res.data[0].weatherinformationPower
+              this.weatherinformationTemperature = res.data[0].weatherinformationTemperature
+              this.weatherinformationTime = res.data[0].weatherinformationTime
+              this.weatherinformationWeather = res.data[0].weatherinformationWeather
             }
           } else {
             this.todatWeather = false