https://github.com/chekun/go-wechat-app
微信小程序SDK for Go,API调用,数据解密
https://github.com/chekun/go-wechat-app
wechat wechat-sdk wechat-sdk-go
Last synced: about 1 year ago
JSON representation
微信小程序SDK for Go,API调用,数据解密
- Host: GitHub
- URL: https://github.com/chekun/go-wechat-app
- Owner: chekun
- License: mit
- Created: 2017-06-09T02:16:58.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2018-06-07T05:39:43.000Z (about 8 years ago)
- Last Synced: 2024-10-19T01:13:33.158Z (over 1 year ago)
- Topics: wechat, wechat-sdk, wechat-sdk-go
- Language: Go
- Homepage:
- Size: 2.93 KB
- Stars: 11
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
微信小程序SDK for Go
===============================
第一个可用版本,随心使用,注意安全 😄
## 目前功能
- 数据解密
- 解密 wx.getUserInfo
- 解密 wx.getShareInfo
- 解密 wx.getWeRunData
- 接口调用
- todo
## 使用方法
- 数据解密
```golang
import (
"fmt"
"github.com/chekun/go-wechat-app/wechat/decrypt"
)
func main() {
decryptor, err := New("your-app-id", "your-session-key")
if err != nil {
fmt.Println(err)//sessionKey不正确
}
if profile := decryptor.Profile( "your-encrypted-data", "your-iv"); decryptor.Err != nil {
fmr.Println("Profile 解密失败 - ", decryptor.Err)
} else {
fmt.Println(profile)
}
if share := decryptor.Share( "your-encrypted-data", "your-iv"); decryptor.Err != nil {
fmr.Println("Share Ticket 解密失败 - ", decryptor.Err)
} else {
fmt.Println(share)
}
if run := decryptor.Run( "your-encrypted-data", "your-iv"); decryptor.Err != nil {
fmr.Println("Run Data 解密失败 - ", decryptor.Err)
} else {
fmt.Println(run)
}
}
```