mirror of
https://github.com/silenceper/wechat.git
synced 2026-02-12 08:42:28 +08:00
handle err
This commit is contained in:
@@ -55,6 +55,9 @@ func (ctx *Context) GetAccessTokenFromServer() (resAccessToken ResAccessToken, e
|
|||||||
url := fmt.Sprintf("%s?grant_type=client_credential&appid=%s&secret=%s", AccessTokenURL, ctx.AppID, ctx.AppSecret)
|
url := fmt.Sprintf("%s?grant_type=client_credential&appid=%s&secret=%s", AccessTokenURL, ctx.AppID, ctx.AppSecret)
|
||||||
var body []byte
|
var body []byte
|
||||||
body, err = util.HTTPGet(url)
|
body, err = util.HTTPGet(url)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
err = json.Unmarshal(body, &resAccessToken)
|
err = json.Unmarshal(body, &resAccessToken)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user