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

tapi.js 的update方法 #8

Closed
iamlaobie opened this issue Jan 16, 2012 · 2 comments
Closed

tapi.js 的update方法 #8

iamlaobie opened this issue Jan 16, 2012 · 2 comments

Comments

@iamlaobie
Copy link

234 update: function(data, callback, context) {
235 if (!data.pic) {
236 this.api_dispatch(data).update(data, callback, context);
237 }
238 // 包含图片
239 var pic = data.pic;
240 delete data.pic;
241 this.api_dispatch(data).upload(data, pic, callback, context);
242 },

如果没有pic的话,应该在update后跟一个return吧?

@dongyuwei
Copy link

@iamlaobie 说的对.否则,当调用update接口时,按目前的代码逻辑,会先执行update后执行upload,最终导致update失败.

测试中发现upload接口正常,但update接口异常( at Object.upload (/usr/local/lib/node_modules/weibo/lib/tsina.js:787:21)
at Object.update (/usr/local/lib/node_modules/weibo/lib/tapi.js:241:27)
at Object.handle (/Users/dyw/code/mail2http/test/mail2weioDemo.js:54:8))

修改为return this.api_dispatch(data).update(data, callback, context);就可以成功update了

@fengmk2
Copy link
Member

fengmk2 commented Jan 30, 2012

ok,我了解了

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

3 participants