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

新增success回复 #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

pascallin
Copy link

全网发布时component_verify_ticket需要回复success,不然无法通过

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.9%) to 72.519% when pulling 555d074 on pascallin:master into 6dbb669 on node-webot:master.

@JacksonTian
Copy link
Member

文档地址发一下,我看一眼。

@pascallin
Copy link
Author

文档地址

4、模拟推送component_verify_ticket给开发者,开发者需按要求回复(接收到后必须直接返回字符串success)。

不然设置this.body = "success",会返回xml格式。微信的服务会判定你返回不是字符串不给通过。

@JacksonTian
Copy link
Member

这个实现并不够好,如果需要发送XML包装的 success 消息怎么办?

@pascallin
Copy link
Author

文档地址

假如服务器无法保证在五秒内处理并回复,必须做出下述回复,这样微信服务器才不会对此作任何处理,并且不会发起重试(这种情况下,可以使用客服消息接口进行异步回复),否则,将出现严重的错误提示。详见下面说明:
1、直接回复success(推荐方式)
2、直接回复空串(指字节长度为0的空字符串,而不是XML结构体中content字段的内容为空)

而且这种情况设置this.body="success",也会导致回复了success。
个人是觉得直接回复success字符串的情况比较少出现,回复内容也可从业务设计上做妥协。

@calvinxiao
Copy link

建议检查handle返回的数据是不是buffer,是buffer的话原样返回给用户。这样可以达到直接回复success的目的。

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

Successfully merging this pull request may close these issues.

4 participants