|
@@ -18,7 +18,7 @@ type WxAccessToken struct {
|
|
|
RefreshToken string `json:"refresh_token"`
|
|
|
Openid string `json:"openid"`
|
|
|
Scope string `json:"scope"`
|
|
|
- Errcode string `json:"errcode"`
|
|
|
+ Errcode int `json:"errcode"`
|
|
|
Errmsg string `json:"errmsg"`
|
|
|
}
|
|
|
|
|
@@ -29,11 +29,11 @@ func WxGetUserOpenIdByCode(code string) (item *WxAccessToken, err error) {
|
|
|
}
|
|
|
requestUrl := `https://api.weixin.qq.com/sns/oauth2/access_token?appid=%s&secret=%s&code=%s&grant_type=authorization_code`
|
|
|
requestUrl = fmt.Sprintf(requestUrl, utils.WxAppId, utils.WxAppSecret, code)
|
|
|
- fmt.Println("requestUrl:", requestUrl)
|
|
|
result, err := http.Get(requestUrl)
|
|
|
if err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
+ utils.FileLog.Info("WxGetUserOpenIdByCode:%s",string(result))
|
|
|
err = json.Unmarshal(result, &item)
|
|
|
return
|
|
|
}
|