Compare commits
2 Commits
5762064979
...
e87107462a
Author | SHA1 | Date |
---|---|---|
|
e87107462a | |
|
a157189aef |
|
@ -39,6 +39,9 @@ func (o *MpSdk) GetUserInfoByJsCode(code string) (*UserInfo, error) {
|
||||||
userInfo := new(UserInfo)
|
userInfo := new(UserInfo)
|
||||||
|
|
||||||
g := gjson.ParseBytes(body)
|
g := gjson.ParseBytes(body)
|
||||||
|
if g.Get("errcode").Int() != 0 {
|
||||||
|
return nil, errors.New(string(body))
|
||||||
|
}
|
||||||
userInfo.Openid = g.Get("openid").String()
|
userInfo.Openid = g.Get("openid").String()
|
||||||
userInfo.Unionid = g.Get("unionid").String()
|
userInfo.Unionid = g.Get("unionid").String()
|
||||||
return userInfo, nil
|
return userInfo, nil
|
||||||
|
|
Loading…
Reference in New Issue