|
|
@ -5,6 +5,13 @@ import ( |
|
|
|
"log" |
|
|
|
) |
|
|
|
|
|
|
|
type wx_access_token_res struct { |
|
|
|
AccessToken string `json:"access_token"` |
|
|
|
ExpiresIn int `json:"expires_in"` |
|
|
|
Errcode int `json:"errcode"` |
|
|
|
Errmsg string `json:"errmsg"` |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 从微信api取access_token |
|
|
|
*/ |
|
|
@ -14,13 +21,6 @@ func GetAccessToken(appid, secret string) (wx_access_token_res, error) { |
|
|
|
|
|
|
|
data_byte, err := SendHttp("GET", url, nil) |
|
|
|
|
|
|
|
type wx_access_token_res struct { |
|
|
|
AccessToken string `json:"access_token"` |
|
|
|
ExpiresIn int `json:"expires_in"` |
|
|
|
Errcode int `json:"errcode"` |
|
|
|
Errmsg string `json:"errmsg"` |
|
|
|
} |
|
|
|
|
|
|
|
var data wx_access_token_res |
|
|
|
|
|
|
|
if err == nil { |
|
|
|