ソースを参照

30min更新天气

wangtao 2 年 前
コミット
0778c94674
1 ファイル変更4 行追加1 行削除
  1. 4 1
      src/components2/weather/index.vue

+ 4 - 1
src/components2/weather/index.vue

@@ -45,6 +45,9 @@ export default {
   },
   created(){
     this.initData()
+    setInterval(()=>{
+      this.initData()
+    },1000*60*30)
   },
   methods: {
     //初始化数据
@@ -52,7 +55,7 @@ export default {
       axios({
             method: 'get',
             url: 'https://smartpark.caih.com/dxapi/aliWeather?area=南宁',
-            timeout: 3000,
+            timeout: 10000,
         }).then(res =>{
             this.data = res.data.showapi_res_body.now
         }).catch(err =>{