From 78fe5537951f18d276485ecb9e95d2daad7f1714 Mon Sep 17 00:00:00 2001 From: Afeyer Date: Sat, 31 Jul 2021 21:39:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84SDK=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- customer.go | 2 +- error.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/customer.go b/customer.go index 69d3a73..ac7b9f9 100644 --- a/customer.go +++ b/customer.go @@ -21,7 +21,7 @@ type CustomerSchema struct { NickName string `json:"nickname"` // 微信昵称 Avatar string `json:"avatar"` // 微信头像。第三方不可获取 Gender int `json:"gender"` // 性别 - UnionID string `json:"unionid"` // unionid,需要绑定微信开发者帐号才能获取到,查看绑定方法: https://open.work.weixin.qq.com/kf/doc/92512/93143/94769#%E5%A6%82%E4%BD%95%E8%8E%B7%E5%8F%96%E5%BE%AE%E4%BF%A1%E5%AE%A2%E6%88%B7%E7%9A%84unionid + UnionID string `json:"unionid"` // unionid,需要绑定微信开发者帐号才能获取到,查看绑定方法: https://open.work.weixin.qq.com/kf/doc/92512/93143/94769#%E5%A6%82%E4%BD%95%E8%8E%B7%E5%8F%96%E5%BE%AE%E4%BF%A1%E5%AE%A2%E6%88%B7%E7%9A%84unionid } // CustomerBatchGetSchema 获取客户基本信息响应内容 diff --git a/error.go b/error.go index 5e4bbcf..0ab11dc 100644 --- a/error.go +++ b/error.go @@ -17,6 +17,8 @@ const ( SDKUnknownError Error = "未知错误" // SDKInvalidCredential 错误码:40001 SDKInvalidCredential Error = "不合法的secret参数" + // SDKInvalidCorpID 错误码:40013 + SDKInvalidCorpID Error = "无效的 CorpID" // SDKAccessTokenInvalid 错误码:40014 SDKAccessTokenInvalid Error = "AccessToken 无效" // SDKAccessTokenExpired 错误码:42001 @@ -41,6 +43,8 @@ func NewSDKErr(code int, msgList ...string) Error { return SDKInvalidCredential case 42001: return SDKAccessTokenExpired + case 40013: + return SDKInvalidCorpID case 40014: return SDKAccessTokenInvalid case 95011: