浏览代码

added networking access fatal error message

master
Patrick Peng Sun 8 年前
父节点
当前提交
1a5557d04b
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. +3
    -0
      accessToken.go

+ 3
- 0
accessToken.go 查看文件

@@ -70,8 +70,11 @@ func renewAuthToken() (AuthToken, error) {
//url := "http://vimeo.com/api/v2/brad/info.json"
url := fmt.Sprintf("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s", APIConfig.Appid, APIConfig.AppSecret)
var myClient = &http.Client{Timeout: 20 * time.Second}
log.Println("renew access token from Internet api.weixin.qq.com")
r, err := myClient.Get(url)
if err != nil {
log.Fatal("http access api.weixin.qq.com failed")
log.Fatal(err)
return AuthToken{}, err
}
defer r.Body.Close()

正在加载...
取消
保存