wendux / fly

:rocket: Supporting request forwarding and Promise based HTTP client for all JavaScript runtimes.
https://wendux.github.io/dist/#/language
MIT License
3.9k stars 639 forks source link

小程序ios端使用锁api报错 #255

Open callmesoul opened 4 years ago

callmesoul commented 4 years ago
if (!store) {
          fly.lock();
          tokenFly.get('/user', {}, { headers: { sessionKey: token } }).then((result) => {
            if(result.data.code === 'C200') {
                store.setUserInfo({ userInfo: result.data.data })
            }
            return request; //只有最终返回request对象时,原来的请求才会继续
          }).finally(()=>{
            fly.unlock();//解锁后,会继续发起请求队列中的任务,详情见后面文档
          })
        }
Uncaught (in promise) thirdScriptError
undefined is not a function (near '...a.data}),o}).finally(function(){n.unlock...')
at (app-service.js:2454:1254)
at t (WASubContext.js:2:65809)
at (WASubContext.js:2:65931)
at e (WASubContext.js:2:68384)
at (WASubContext.js:2:32600)
at r (WASubContext.js:2:32299)
at (WAServiceMainContext.js:2:127503)
at (WASubContext.js:2:92717)
at (WASubContext.js:2:99161)
_onNativeTimer
global code

安卓不怕

好像是finally问题,删了旧不报错了, 暂时在success里面解锁,不用finally了 但是在success 里面解锁发现了个问题就就是,原来锁住的请求设置和token retrun出去了,还是没有带token,也就是说第一接口带不了token

cosmoyqt commented 2 years ago

怎么解决的