- add WeixinPageAPI
This commit is contained in:
@@ -47,9 +47,9 @@ func init() {
|
||||
func (a *Auther) VerifySecret(state, code string) (authBind *model.AuthBind, err error) {
|
||||
globals.SugarLogger.Debugf("weixin VerifySecret code:%s", code)
|
||||
if state == "" {
|
||||
token, err2 := api.WeixinAPI.SNSRetrieveToken(code)
|
||||
token, err2 := api.WeixinPageAPI.SNSRetrieveToken(code)
|
||||
if err = err2; err == nil {
|
||||
wxUserinfo, err2 := api.WeixinAPI.SNSGetUserInfo(token.AccessToken, token.OpenID)
|
||||
wxUserinfo, err2 := api.WeixinPageAPI.SNSGetUserInfo(token.AccessToken, token.OpenID)
|
||||
if err = err2; err == nil {
|
||||
db := dao.GetDB()
|
||||
if authBind, err = dao.GetAuthBind(db, "", a.authType, wxUserinfo.OpenID); dao.IsNoRowsError(err) {
|
||||
|
||||
@@ -51,6 +51,9 @@ weimobAppSecret = "7267AA7F58261F6965599218F5A1D592"
|
||||
weimobStateSecret = "87ae9570-92dc-4c01-bcd9-1a15d441df6b"
|
||||
weimobCallbackURL = "http://callback.test.jxc4.com/weimob"
|
||||
|
||||
weixinPageAppID = "wx018dbe7daa3d5627"
|
||||
weixinPageSecret = "c7a84ed3ef3ae04ac78e02fb593ffbe5"
|
||||
|
||||
[dev]
|
||||
jdToken = "c8854ef2-f80a-45ee-aceb-dc8014d646f8"
|
||||
jdAppKey = "06692746f7224695ad4788ce340bc854"
|
||||
|
||||
@@ -30,6 +30,7 @@ var (
|
||||
MtwmAPI *mtwmapi.API
|
||||
WeixinAPI *weixinapi.API
|
||||
WeixinMiniAPI *weixinapi.API
|
||||
WeixinPageAPI *weixinapi.API
|
||||
|
||||
AutonaviAPI *autonavi.API
|
||||
QiniuAPI *qbox.Mac
|
||||
@@ -65,6 +66,7 @@ func Init() {
|
||||
}
|
||||
}
|
||||
WeixinMiniAPI = weixinapi.New(beego.AppConfig.String("weixinMiniAppID"), beego.AppConfig.String("weixinMiniSecret"))
|
||||
WeixinPageAPI = weixinapi.New(beego.AppConfig.String("weixinPageAppID"), beego.AppConfig.String("weixinPageSecret"))
|
||||
|
||||
AutonaviAPI = autonavi.New(beego.AppConfig.String("autonaviKey"))
|
||||
QiniuAPI = qbox.NewMac(beego.AppConfig.String("qiniuAK"), beego.AppConfig.String("qiniuSK"))
|
||||
|
||||
Reference in New Issue
Block a user