wxlogin
This commit is contained in:
@@ -2,6 +2,8 @@ package weixin
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"git.rosy.net.cn/baseapi/platformapi/weixinapi"
|
||||
"git.rosy.net.cn/jx-callback/business/auth2"
|
||||
"git.rosy.net.cn/jx-callback/business/auth2/authprovider"
|
||||
@@ -68,18 +70,8 @@ func (a *Auther) VerifySecret(id, secret string) (authBindEx *auth2.AuthBindEx,
|
||||
state := id
|
||||
code := jsCode
|
||||
if state == "" {
|
||||
token, err2 := a.getAPI().SNSRetrieveToken(code)
|
||||
if err = err2; err == nil {
|
||||
openID = token.OpenID
|
||||
accessToken = token.AccessToken
|
||||
}
|
||||
} else {
|
||||
err = ErrStateIsWrong
|
||||
}
|
||||
} else if a.authType == AuthTypeWxApp {
|
||||
state := id
|
||||
code := jsCode
|
||||
if state == "" {
|
||||
temp := a.getAPI()
|
||||
fmt.Printf("secret=%s,appid=%s", temp.GetSecret(), temp.GetAppID())
|
||||
token, err2 := a.getAPI().SNSRetrieveToken(code)
|
||||
if err = err2; err == nil {
|
||||
openID = token.OpenID
|
||||
|
||||
Reference in New Issue
Block a user