|
@@ -115,7 +115,12 @@ func GetOpenId(code string) (info *WxUserToken, err error) {
|
|
|
|
|
|
httpUrl := `https://api.weixin.qq.com/sns/oauth2/access_token?
|
|
|
appid=%s&secret=%s&code=%s&grant_type=authorization_code`
|
|
|
- httpUrl = fmt.Sprintf(httpUrl, utils.WX_APPID, utils.WX_APP_SECRET, code)
|
|
|
+
|
|
|
+ confMap, err := models.GetMiniConf()
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ httpUrl = fmt.Sprintf(httpUrl, confMap["WxAppId"], confMap["WxAppSecret"], code)
|
|
|
|
|
|
client := http.Client{}
|
|
|
wxReq, err := http.NewRequest("GET", httpUrl, nil)
|