removed url as a command line argument and added it as a constant as the API url is always the same

This commit is contained in:
Clement Venard
2017-11-29 16:06:52 +08:00
parent a1f917fd3e
commit e6c88df690
2 changed files with 2 additions and 9 deletions
+2 -2
View File
@@ -89,8 +89,8 @@ func (p Plugin) Exec() error {
var buf bytes.Buffer
var b []byte
// GET request to get the access token
accessURL := p.Config.URL + p.Config.CorpID + "&corpsecret=" + p.Config.CorpSecret
// construct URL to get access token
accessURL := "https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=" + p.Config.CorpID + "&corpsecret=" + p.Config.CorpSecret
fmt.Println("URL:>", accessURL)
req, err := http.NewRequest("GET", accessURL, bytes.NewBuffer(b))