Browse Source

修复bug

master v0.4.7
listen 3 years ago
parent
commit
eb61287f73
2 changed files with 21 additions and 10 deletions
  1. +10
    -10
      common.go
  2. +11
    -0
      miniapp_qrcode.client_test.go

+ 10
- 10
common.go View File

@ -63,11 +63,11 @@ type MiniAppOpenidReq struct {
* 获取小程序openid返回参数 * 获取小程序openid返回参数
*/ */
type MiniAppOpenidRes struct { type MiniAppOpenidRes struct {
Openid string
SessionKey interface{}
Unionid interface{}
NickName string
AvatarUrl string
Openid string `json:"openid"`
SessionKey interface{} `json:"session_key"`
Unionid interface{} `json:"unionid"`
NickName string `json:"nick_name"`
AvatarUrl string `json:"avatar_url"`
WxApiRes WxApiRes
} }
@ -75,11 +75,11 @@ type MiniAppOpenidRes struct {
* 获取公众号openid返回参数 * 获取公众号openid返回参数
*/ */
type MpOpenidRes struct { type MpOpenidRes struct {
AccessToken string
ExpiresIn string
RefreshToken string
Openid string
Scope string
AccessToken string `json:"access_token"`
ExpiresIn string `json:"expires_in"`
RefreshToken string `json:"refresh_token"`
Openid string `json:"openid"`
Scope string `json:"scope"`
} }
/** /**


+ 11
- 0
miniapp_qrcode.client_test.go View File

@ -13,4 +13,15 @@ func Test_GetMiniappCode(t *testing.T){
t.Log(qrcode) t.Log(qrcode)
t.Log(err) t.Log(err)
}
func Test_GetMiniappOpenid(t *testing.T){
appid := "wx3d53ccbaf69f7995"
appSecret := "165983626235636be54a16404e3e70a7"
js_code := "063iBAll27ez884FT6nl254pW02iBAlw"
res,err := GetMiniAppOpenid(appid,appSecret,js_code)
t.Log(res)
t.Log(err)
} }

Loading…
Cancel
Save