- add WeixinPageAPI

This commit is contained in:
gazebo
2019-03-05 14:48:58 +08:00
parent 9447fc8929
commit 782c686356
3 changed files with 7 additions and 2 deletions

View File

@@ -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) {