|
@@ -634,30 +634,13 @@ func GetStoryScoreList(activityID int64, page int64, limit int64) (score []*mode
|
634
|
634
|
return score, total, err
|
635
|
635
|
}
|
636
|
636
|
|
637
|
|
-//func GetOpenId(appid string,secret string,grant_type string,code string)(string, error)
|
638
|
|
-//
|
639
|
|
-// var code2sessionURL = "https://xcx.kuyicloud.com/xcx/api/mobile/getappid?appid="
|
640
|
|
-//
|
641
|
|
-// url := fmt.Sprintf(code2sessionURL, appID, appSecret, code)
|
642
|
|
-// resp, err := http.DefaultClient.Get(url)
|
643
|
|
-// if err != nil {
|
644
|
|
-// return "", err
|
645
|
|
-// }
|
646
|
|
-// var wxMap map[string]string
|
647
|
|
-// err = json.NewDecoder(resp.Body).Decode(&wxMap)
|
648
|
|
-// if err != nil {
|
649
|
|
-// return "", err
|
650
|
|
-// }
|
651
|
|
-// defer resp.Body.Close()
|
652
|
|
-//
|
653
|
|
-// return wxMap["openid"], nil
|
654
|
|
-//}
|
655
|
|
-
|
656
|
637
|
func SendWxAuthAPI(appID string, appSecret string, grant_type string, code string) (string, error) {
|
657
|
|
- var code2sessionURL = "https://api.weixin.qq.com/sns/jscode2session?appid=" + appID + "&secret=" + appSecret + "&js_code=" + code + "&grant_type=" + grant_type
|
|
638
|
+
|
|
639
|
+ var code2sessionURL = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=" + appID + "&secret=" + appSecret + "&code=" + code + "&grant_type=" + grant_type
|
658
|
640
|
var url = fmt.Sprintf(code2sessionURL, appID, appSecret, code)
|
659
|
641
|
fmt.Println("url233232323322323", url)
|
660
|
642
|
resp, err := http.DefaultClient.Get(url)
|
|
643
|
+ fmt.Println("resp32332232332322", resp)
|
661
|
644
|
if err != nil {
|
662
|
645
|
return "", err
|
663
|
646
|
}
|
|
@@ -672,7 +655,7 @@ func SendWxAuthAPI(appID string, appSecret string, grant_type string, code strin
|
672
|
655
|
}
|
673
|
656
|
|
674
|
657
|
func SendWxAuthAPIOne(appID string, appSecret string, grant_type string, code string) (string, error) {
|
675
|
|
- var code2sessionURL = "https://api.weixin.qq.com/sns/jscode2session?appid=" + appID + "&secret=" + appSecret + "&js_code=" + code + "&grant_type=" + grant_type
|
|
658
|
+ var code2sessionURL = "GET https://api.weixin.qq.com/sns/jscode2session?appid=" + appID + "&secret=" + appSecret + "&js_code=" + code + "&grant_type=" + grant_type
|
676
|
659
|
var url = fmt.Sprintf(code2sessionURL, appID, appSecret, code)
|
677
|
660
|
fmt.Println("url233232323322323", url)
|
678
|
661
|
resp, err := http.DefaultClient.Get(url)
|