码迷,mamicode.com
首页 > 移动开发 > 详细

axios 设置超时时间 timeout

时间:2018-06-18 16:01:36      阅读:1867      评论:0      收藏:0      [点我收藏+]

标签:ring   err   catch   div   成功   style   amp   rate   ESS   

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)
        })

 

axios 设置超时时间 timeout

标签:ring   err   catch   div   成功   style   amp   rate   ESS   

原文地址:https://www.cnblogs.com/mengfangui/p/9195216.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!