mirror of
https://github.com/silenceper/wechat.git
synced 2026-02-10 07:42:26 +08:00
check errcode in ListUserOpenIDs (#312)
Co-authored-by: huangxiang <huangxiang@didichuxing.com>
This commit is contained in:
@@ -52,6 +52,8 @@ type Info struct {
|
|||||||
|
|
||||||
// OpenidList 用户列表
|
// OpenidList 用户列表
|
||||||
type OpenidList struct {
|
type OpenidList struct {
|
||||||
|
util.CommonError
|
||||||
|
|
||||||
Total int `json:"total"`
|
Total int `json:"total"`
|
||||||
Count int `json:"count"`
|
Count int `json:"count"`
|
||||||
Data struct {
|
Data struct {
|
||||||
@@ -124,13 +126,14 @@ func (user *User) ListUserOpenIDs(nextOpenid ...string) (*OpenidList, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
userlist := new(OpenidList)
|
userlist := OpenidList{}
|
||||||
err = json.Unmarshal(response, userlist)
|
|
||||||
|
err = util.DecodeWithError(response, &userlist, "ListUserOpenIDs")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return userlist, nil
|
return &userlist, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ListAllUserOpenIDs 返回所有用户OpenID列表
|
// ListAllUserOpenIDs 返回所有用户OpenID列表
|
||||||
|
|||||||
Reference in New Issue
Block a user