We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
V3增加了context,可以通过context来控制timeout超时请求后,强制取消该词业务请求
// ------ 比如 强制取消获取部门列表接口 ------ ctx,cancel := context.WithTimeout(context.Background(), 1*time.Second) dept,err := wechatWork.Department.List(ctx, id) // ------ PowerLib中的单元测试 ------ func TestDataflow_WithContext(t *testing.T) { df := InitBaseDataflow() ctx, cancel := context.WithCancel(context.Background()) done := make(chan struct{}, 1) go func() { time.Sleep(time.Second * 1) _, err := df.WithContext(ctx).Request() if !errors.Is(err, context.Canceled) { t.Error("cancel failed") } done <- struct{}{} }() cancel() select { case <-done: } }
这个是由于Token和AESKey没有配置导致的,这个在公众号、企业微信配置里面都有这个参数,用来消息回调解密用。如果暂时不用消息解密,随便设置一个字符串进去即可。
例如:
officialAccount.NewOfficialAccount(&officialAccount.UserConfig{ AppID: conf.OffiAccount.AppID, // 小程序、公众号或者企业微信的appid Secret: conf.OffiAccount.AppSecret, // 商户号 appID Token: "xxx", AESKey: "xxx", ResponseType: os.Getenv("response_type"), Log: officialAccount.Log{ Level: "debug", File: "./wechat.log", }, Cache: cache, HttpDebug: true, Debug: false, //"sandbox": true, })
The text was updated successfully, but these errors were encountered:
不能随便设置AESKey和Token,随便设置会报错
Sorry, something went wrong.
No branches or pull requests
V3支持“超时请求取消机制”
V3增加了context,可以通过context来控制timeout超时请求后,强制取消该词业务请求
初始化报错 illegal base64 data at input byte 0
这个是由于Token和AESKey没有配置导致的,这个在公众号、企业微信配置里面都有这个参数,用来消息回调解密用。如果暂时不用消息解密,随便设置一个字符串进去即可。
例如:
The text was updated successfully, but these errors were encountered: