|
|
@@ -106,16 +106,16 @@ func (self *MpController) Config() {
|
|
|
|
|
|
//微信JS-SDK配置注入
|
|
|
func (self *MpController) GetAccessToken() {
|
|
|
- // type Ret struct {
|
|
|
- // Token string `json:"token"`
|
|
|
- // }
|
|
|
- // appId := self.GetString("a")
|
|
|
- // appSecret := self.GetString("s")
|
|
|
- // token := wx_mp.GetAccessToken(appId, appSecret)
|
|
|
- // beego.BeeLogger.Warn("rails get token(%s, %s)=%s", appId, appSecret, token)
|
|
|
- // ret := &Ret{Token: token}
|
|
|
- // self.Data["json"] = ret
|
|
|
- // self.ServeJSON()
|
|
|
+ type Ret struct {
|
|
|
+ Token string `json:"token"`
|
|
|
+ }
|
|
|
+ appId := self.GetString("a")
|
|
|
+ appSecret := self.GetString("s")
|
|
|
+ token := wx_mp.GetAccessToken(appId, appSecret)
|
|
|
+ beego.BeeLogger.Warn("rails get token(%s, %s)=%s", appId, appSecret, token)
|
|
|
+ ret := &Ret{Token: token}
|
|
|
+ self.Data["json"] = ret
|
|
|
+ self.ServeJSON()
|
|
|
}
|
|
|
|
|
|
//是否关注公众号
|