XMLWAN 3 vuotta sitten
vanhempi
commit
5aa839c1e7
1 muutettua tiedostoa jossa 4 lisäystä ja 5 poistoa
  1. 4 5
      service/xcx_mobile_api_service.go

+ 4 - 5
service/xcx_mobile_api_service.go Näytä tiedosto

@@ -636,10 +636,10 @@ func GetStoryScoreList(activityID int64, page int64, limit int64) (score []*mode
636 636
 
637 637
 func SendWxAuthAPI(appID string, appSecret string, grant_type string, code string) (string, error) {
638 638
 
639
-	var code2sessionURL = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=" + appID + "&secret=" + appSecret + "&code=" + code + "&grant_type=" + grant_type
639
+	var code2sessionURL = "https://api.weixin.qq.com/sns/jscode2session?appid=" + appID + "&secret=" + appSecret + "&js_code=" + code + "&grant_type=" + grant_type
640 640
 	var url = fmt.Sprintf(code2sessionURL, appID, appSecret, code)
641 641
 	fmt.Println("url233232323322323", url)
642
-	resp, err := http.DefaultClient.Get(url)
642
+	resp, err := http.DefaultClient.Get(code2sessionURL)
643 643
 	fmt.Println("resp32332232332322", resp)
644 644
 	if err != nil {
645 645
 		return "", err
@@ -655,10 +655,9 @@ func SendWxAuthAPI(appID string, appSecret string, grant_type string, code strin
655 655
 }
656 656
 
657 657
 func SendWxAuthAPIOne(appID string, appSecret string, grant_type string, code string) (string, error) {
658
-	var code2sessionURL = "GET https://api.weixin.qq.com/sns/jscode2session?appid=" + appID + "&secret=" + appSecret + "&js_code=" + code + "&grant_type=" + grant_type
658
+	var code2sessionURL = "https://api.weixin.qq.com/sns/jscode2session?appid=" + appID + "&secret=" + appSecret + "&js_code=" + code + "&grant_type=" + grant_type
659 659
 	var url = fmt.Sprintf(code2sessionURL, appID, appSecret, code)
660
-	fmt.Println("url233232323322323", url)
661
-	resp, err := http.DefaultClient.Get(url)
660
+	resp, err := http.DefaultClient.Get(code2sessionURL)
662 661
 	if err != nil {
663 662
 		return "", err
664 663
 	}