Skip to content

Commit

Permalink
v1.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
iGoogle-ink committed Mar 9, 2023
1 parent 97e8e1e commit ba33044
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 29 deletions.
20 changes: 10 additions & 10 deletions doc/mini.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import (
)

// 初始化微信小程序 SDK
// Appid:Appid
// Secret:appSecret
// autoManageToken:是否自动获取并自动维护刷新 AccessToken
// Appid:Appid
// Secret:appSecret
// autoManageToken:是否自动获取并自动维护刷新 AccessToken
miniSDK, err := mini.New(Appid, Secret, true)
if err != nil {
xlog.Error(err)
Expand All @@ -47,13 +47,13 @@ import (
at := miniSDK.GetMiniAccessToken()

// 每次刷新 accessToken 后,此方法回调返回 accessToken 和 有效时间(秒)
miniSDK.SetMiniAccessTokenCallback(func(accessToken string, expireIn int, err error) {
if err != nil {
xlog.Errorf("refresh access token error(%+v)", err)
return
}
xlog.Infof("accessToken: %s", accessToken)
xlog.Infof("expireIn: %d", expireIn)
miniSDK.SetMiniAccessTokenCallback(func(appid, accessToken string, expireIn int, err error) {
if err != nil {
xlog.Errorf("refresh access token error(%+v)", err)
return
}
xlog.Infof("appid:%s, accessToken: %s",appid, accessToken)
xlog.Infof("expireIn: %d", expireIn)
})
```

Expand Down
36 changes: 18 additions & 18 deletions doc/public.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import (
)

// 初始化微信公众号 SDK
// Appid:Appid
// Secret:appSecret
// autoManageToken:是否自动获取并自动维护刷新 AccessToken
// Appid:Appid
// Secret:appSecret
// autoManageToken:是否自动获取并自动维护刷新 AccessToken
publicSDK, err := public.New(Appid, Secret, true)
if err != nil {
xlog.Error(err)
Expand All @@ -45,13 +45,13 @@ import (
at := publicSDK.GetPublicAccessToken()

// 每次刷新 accessToken 后,此方法回调返回 accessToken 和 有效时间(秒)
publicSDK.SetPublicAccessTokenCallback(func(accessToken string, expireIn int, err error) {
if err != nil {
xlog.Errorf("refresh access token error(%+v)", err)
return
}
xlog.Infof("accessToken: %s", accessToken)
xlog.Infof("expireIn: %d", expireIn)
publicSDK.SetPublicAccessTokenCallback(func(appid, accessToken string, expireIn int, err error) {
if err != nil {
xlog.Errorf("refresh access token error(%+v)", err)
return
}
xlog.Infof("appid:%s, accessToken: %s",appid, accessToken)
xlog.Infof("expireIn: %d", expireIn)
})
```

Expand All @@ -62,17 +62,17 @@ publicSDK.SetPublicAccessTokenCallback(func(accessToken string, expireIn int, er
body := make(bm.BodyMap)
// 临时二维码
body.Set("expire_seconds", 604800).
Set("action_name", "QR_SCENE").
SetBodyMap("action_info", func(b bm.BodyMap) {
b.SetBodyMap("scene", func(b bm.BodyMap) {
b.Set("scene_id", 123)
})
})
Set("action_name", "QR_SCENE").
SetBodyMap("action_info", func(b bm.BodyMap) {
b.SetBodyMap("scene", func(b bm.BodyMap) {
b.Set("scene_id", 123)
})
})

rsp, err := publicSDK.QRCodeCreate(ctx, body)
if err != nil {
xlog.Error(err)
return
xlog.Error(err)
return
}
xlog.Infof("rsp:%+v", rsp)
```
Expand Down
3 changes: 2 additions & 1 deletion release_note.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
版本号:Release 1.1.3
版本号:Release 1.1.4
修改记录:
(1) 修复开放平台问题,重新设计开放平台相关接口以及token维护机制
(2) 小程序、公众号平台,AccessToken回调增加 appid 返回

版本号:Release 1.1.1
修改记录:
Expand Down

0 comments on commit ba33044

Please sign in to comment.