taro-request icon indicating copy to clipboard operation
taro-request copied to clipboard

支付宝小程序请求不走proceed这个方法?

Open liuyunzyj opened this issue 6 years ago • 5 comments

image

liuyunzyj avatar Aug 22 '19 13:08 liuyunzyj

调试了一下,是有这个问题。官方的bug 官方文档里说支持支付宝

TigerHee avatar Aug 23 '19 02:08 TigerHee

@liuyunzyj 我的小程序最近也要转为支付宝小程序遇到同样的问题,然后发现可以在chain.proceed的catch内处理可行。

return chain.proceed(requestParams).then(res=>{}).catch(err=>{
    if (err.status === HTTP_STATUS.AUTHENTICATE) {
      Taro.setStorageSync("Authorization", "");
      pageToLogin()
      return Promise.reject("需要鉴权");
    }
  })

TigerHee avatar Sep 02 '19 08:09 TigerHee

我也是在catch内处理的

liuyunzyj avatar Sep 02 '19 08:09 liuyunzyj

可是在catch内处理的话,拿不到接口返回的数据。我在被这个问题所困扰

TiAmo-code avatar Apr 25 '20 03:04 TiAmo-code

可是在catch内处理的话,拿不到接口返回的数据。我在被这个问题所困扰

error就是服务端抛出的数据哒

tigerHeeJS avatar Apr 27 '20 02:04 tigerHeeJS