axios 异常捕获

1.

 this.$http.post('/proxy/eventMonitorLog/cancelEventMonitorByCode', {
        "wardCode": this.$store.getters.env().wardCode
      }).then(response=>{       
      }).catch(error=>{
        console.log(error)       
      })

2.

try {
        let response = await this.$http
        .post('/proxy/eventMonitorLog/getEventMonitorListByCode', { wardCode: this.$store.getters.env().wardCode })
        this.outBedsData = response.data.body
        loadingInstance.close()
      } catch (error) {
        console.log(error)
      }

  

posted @ 2020-04-10 10:33  青春无敌小宇宙  阅读(4555)  评论(0编辑  收藏  举报