Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
callmesoul opened this issue Apr 15, 2020 · 1 comment
Open

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

callmesoul opened this issue Apr 15, 2020 · 1 comment

Comments

@callmesoul
Copy link

callmesoul commented Apr 15, 2020

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
Copy link

怎么解决的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants