mirror of
https://github.com/silenceper/wechat.git
synced 2026-02-23 13:42:25 +08:00
fix: formatURL name
This commit is contained in:
@@ -116,7 +116,7 @@ func (r *Client) DepartmentList() ([]*Department, error) {
|
|||||||
//
|
//
|
||||||
// @desc https://developer.work.weixin.qq.com/document/path/90208
|
// @desc https://developer.work.weixin.qq.com/document/path/90208
|
||||||
func (r *Client) DepartmentListByID(departmentID int) ([]*Department, error) {
|
func (r *Client) DepartmentListByID(departmentID int) ([]*Department, error) {
|
||||||
var formatUrl string
|
var formatURL string
|
||||||
|
|
||||||
// 获取accessToken
|
// 获取accessToken
|
||||||
accessToken, err := r.GetAccessToken()
|
accessToken, err := r.GetAccessToken()
|
||||||
@@ -125,15 +125,15 @@ func (r *Client) DepartmentListByID(departmentID int) ([]*Department, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if departmentID > 0 {
|
if departmentID > 0 {
|
||||||
formatUrl =
|
formatURL =
|
||||||
fmt.Sprintf(departmentListByIDURL, accessToken, departmentID)
|
fmt.Sprintf(departmentListByIDURL, accessToken, departmentID)
|
||||||
} else {
|
} else {
|
||||||
formatUrl =
|
formatURL =
|
||||||
fmt.Sprintf(departmentListURL, accessToken)
|
fmt.Sprintf(departmentListURL, accessToken)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 发起http请求
|
// 发起http请求
|
||||||
response, err := util.HTTPGet(formatUrl)
|
response, err := util.HTTPGet(formatURL)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user