Skip to content

Commit 42de4f8

Browse files
committed
example compile error fix
1 parent 0ecd557 commit 42de4f8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

examples/beego/beego.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"github.com/astaxie/beego/context"
88
"github.com/yaotian/gowechat"
99
"github.com/yaotian/gowechat/mp/message"
10-
"github.com/yaotian/gowechat/mp/oauth"
10+
"github.com/yaotian/gowechat/mp/user"
1111
"github.com/yaotian/gowechat/wxcontext"
1212
)
1313

@@ -58,14 +58,14 @@ func wxOAuth(ctx *context.Context) {
5858

5959
oauthHandler := mp.GetPageOAuthHandler(ctx.Request, ctx.ResponseWriter, appURL+"/oauth")
6060

61-
oauthHandler.SetFuncCheckOpenIDExisting(func(openID string) bool {
61+
oauthHandler.SetFuncCheckOpenIDExisting(func(openID string) (existing bool, stopNow bool) {
6262
//看自己的系统中是否已经存在此openID的用户
6363
//如果已经存在, 调用自己的Login 方法,设置cookie等,return true
6464
//如果还不存在,return false, handler会自动去取用户信息
65-
return true
65+
return false, true
6666
})
6767

68-
oauthHandler.SetFuncAfterGetUserInfo(func(user oauth.UserInfo) bool {
68+
oauthHandler.SetFuncAfterGetUserInfo(func(user user.Info) bool {
6969
//已获得用户信息,这里用信息做注册使用
7070
//调用自己的Login方法,设置cookie等
7171
return false

0 commit comments

Comments
 (0)