Jerry 7 лет назад
Родитель
Сommit
61c4aef68c
1 измененных файлов с 12 добавлено и 0 удалено
  1. 12 0
      wechat_client_test.go

+ 12 - 0
wechat_client_test.go

@@ -274,3 +274,15 @@ func TestMd5(t *testing.T) {
 	upper := strings.ToUpper(hex.EncodeToString(sum))
 	fmt.Println(" ssad  ", upper)
 }
+
+func TestGetWeChatUserId(t *testing.T) {
+	userIdRsp, err := GetWeChatUserId(appID, secretKey, "")
+	if err != nil {
+		fmt.Println("err:", err)
+		return
+	}
+	fmt.Println("OpenID:", userIdRsp.Openid)
+	fmt.Println("UnionID:", userIdRsp.Unionid)
+	fmt.Println("SessionKey:", userIdRsp.SessionKey)
+
+}