1
0
mirror of https://github.com/silenceper/wechat.git synced 2026-02-04 12:52:27 +08:00

check errcode in ListUserOpenIDs (#312)

Co-authored-by: huangxiang <huangxiang@didichuxing.com>
This commit is contained in:
huangx
2020-08-11 09:46:59 +08:00
committed by GitHub
parent 404d522d09
commit a6eb2eedc3

View File

@@ -52,6 +52,8 @@ type Info struct {
// OpenidList 用户列表
type OpenidList struct {
util.CommonError
Total int `json:"total"`
Count int `json:"count"`
Data struct {
@@ -124,13 +126,14 @@ func (user *User) ListUserOpenIDs(nextOpenid ...string) (*OpenidList, error) {
return nil, err
}
userlist := new(OpenidList)
err = json.Unmarshal(response, userlist)
userlist := OpenidList{}
err = util.DecodeWithError(response, &userlist, "ListUserOpenIDs")
if err != nil {
return nil, err
}
return userlist, nil
return &userlist, nil
}
// ListAllUserOpenIDs 返回所有用户OpenID列表