CheckEncryptedDataContext .检查加密信息是否由微信生成(当前只支持手机号加密数据),只能检测最近3天生成的加密数据
(ctx context2.Context, encryptedMsgHash string)
| 124 | |
| 125 | // CheckEncryptedDataContext .检查加密信息是否由微信生成(当前只支持手机号加密数据),只能检测最近3天生成的加密数据 |
| 126 | func (auth *Auth) CheckEncryptedDataContext(ctx context2.Context, encryptedMsgHash string) (result RspCheckEncryptedData, err error) { |
| 127 | var response []byte |
| 128 | var ( |
| 129 | at string |
| 130 | ) |
| 131 | if at, err = auth.GetAccessTokenContext(ctx); err != nil { |
| 132 | return |
| 133 | } |
| 134 | |
| 135 | // 由于GetPhoneNumberContext需要传入JSON,所以HTTPPostContext入参改为[]byte |
| 136 | if response, err = util.HTTPPostContext(ctx, fmt.Sprintf(checkEncryptedDataURL, at), []byte("encrypted_msg_hash="+encryptedMsgHash), nil); err != nil { |
| 137 | return |
| 138 | } |
| 139 | if err = util.DecodeWithError(response, &result, "CheckEncryptedDataAuth"); err != nil { |
| 140 | return |
| 141 | } |
| 142 | return |
| 143 | } |
| 144 | |
| 145 | // GetPhoneNumberResponse 新版获取用户手机号响应结构体 |
| 146 | type GetPhoneNumberResponse struct { |
no test coverage detected