美文网首页
人人开源前后端分离-axios设置超时时间 timeout

人人开源前后端分离-axios设置超时时间 timeout

作者: 唏嘘的码农 | 来源:发表于2022-10-13 14:43 被阅读0次

单独对某个请求设置网络超时(亲测有效):

let timeout = parseInt(paramsTimeout);

this.$http.post(url, params, {timeout: timeout})

  .then(res => {

    console.log('response='+response);

  })

  .catch(reason => {

    console.log('reason'+reason);

  })

})

参考自:https://www.cnblogs.com/webSnow/p/16033370.html

相关文章

网友评论

      本文标题:人人开源前后端分离-axios设置超时时间 timeout

      本文链接:https://www.haomeiwen.com/subject/kkhczrtx.html