fly icon indicating copy to clipboard operation
fly copied to clipboard

mpvue中设置了config的timeout不起作用

Open jiaopen opened this issue 6 years ago • 4 comments

如题

jiaopen avatar Jul 23 '18 15:07 jiaopen

    fly.config.timeout = 10000
    fly.interceptors.request.use((config, promise) => {
      config.timeout = 10000
      return config
    })

jiaopen avatar Jul 23 '18 15:07 jiaopen

@jiaopen 你说的不起作用是超时后指请求没有触发catch回调还是指超时时已经触发了catch回调,但真正的请求依然在继续?

:octocat: From gitme Android

wendux avatar Aug 23 '18 01:08 wendux

我也遇到类似问题。发起请求后,直接报timeout。 在开发工具中正常,在真机中直接报timeout,根本没有等待 _20181210155712

fly.config = {
    // baseURL: "http://127.0.0.1:7001/", //请求基地址
        headers: {
        token: wx.getStorageSync('token') || null
    },
    parseJson: true,
    timeout: "60000" //超时时间
}

luo-geng avatar Dec 10 '18 07:12 luo-geng

时间太久远。。已经不记得当时场景了。抱歉

jiaopen avatar Dec 24 '18 07:12 jiaopen