打赏

axios 设置超时时间 timeout

this.$ajax.post('', {operate: type, ids: this.data.id.toString(), data_type: 'ips'}, {timeout: 60000})
        .then(res => {
          if (res.status) {
            this.$message({
              message: '云操成功',
              type: 'success'
            })
          }
        })
        .catch(_ => {
          this.errMessage = (_ && _.data && Object.prototype.toString.call(_.data) === '[object Array]') ? _.data[0][Object.keys(_.data[0])[0]] : _.message
          this.$message.error(this.errMessage)
        })

 

posted @ 2018-06-18 14:54  孟繁贵  阅读(21088)  评论(0编辑  收藏  举报
TOP