延长某个接口的响应超时时间

方法一:直接在定义接口时添加timeout: 6000

export function getLogList(params) {
    return request({
        url: getUrl('list'),
        method: 'get',
        timeout: 100000, // 接口响应超时时间
        params
    })
}

方法二:

import axios from 'axios'
import {BASE_URL} from '@/utils/request'

methods: {
	getList() {
		const instance = axios.create({
			timeout: 100000,  // 接口响应超时时间
		})
		instance.get(`${BASE_URL}/system/list`).then(response => {
			console.log('接口成功时的回调')
		}).catch(() => {})
	}
}

相关推荐

  1. 延长某个接口响应超时时间

    2024-06-06 19:12:06       28 阅读
  2. 关于SpringBoot MVC接口超时时间分析

    2024-06-06 19:12:06       37 阅读
  3. 记录一个apisix修改后台接口超时时间方法

    2024-06-06 19:12:06       31 阅读
  4. mysql和Oracle 查询某个时间之内数据

    2024-06-06 19:12:06       66 阅读
  5. linux查看某个时间日志(sed -n)

    2024-06-06 19:12:06       62 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-06-06 19:12:06       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-06-06 19:12:06       106 阅读
  3. 在Django里面运行非项目文件

    2024-06-06 19:12:06       87 阅读
  4. Python语言-面向对象

    2024-06-06 19:12:06       96 阅读

热门阅读

  1. 如何更精准定位你的Facebook广告受众?

    2024-06-06 19:12:06       31 阅读
  2. Python - 深度学习系列36 重塑实体识别3

    2024-06-06 19:12:06       21 阅读
  3. python方法

    2024-06-06 19:12:06       31 阅读
  4. 【npm】创建和发布无作用域的公共包

    2024-06-06 19:12:06       28 阅读
  5. 容器是什么?

    2024-06-06 19:12:06       28 阅读
  6. 如何用pip查看安装了哪些库?

    2024-06-06 19:12:06       28 阅读
  7. 阿里巴巴出品的6款AI神器,你用过几个?

    2024-06-06 19:12:06       32 阅读
  8. 浅谈InoDB中的行级锁

    2024-06-06 19:12:06       30 阅读