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)
        })
export function _UploadXls(data){
  return axios.post(http+'/api/File/import/xls/mtr',data,{timeout: 2000})
}

你可能感兴趣的:(axios 设置超时时间 timeout)