From 54a878e166a7c44a88cf595e36c2dc73988c70ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Wed, 22 Apr 2020 14:21:28 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95bug=EF=BC=8C=E6=9C=89?= =?UTF-8?q?=E5=8F=AF=E8=83=BD=E6=98=AF=E6=96=B0=E7=94=A8=E6=88=B7=E6=B2=A1?= =?UTF-8?q?=E6=9C=89userid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/auth2/auth2.go | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/business/auth2/auth2.go b/business/auth2/auth2.go index 6521ef93b..9585578ea 100644 --- a/business/auth2/auth2.go +++ b/business/auth2/auth2.go @@ -278,14 +278,16 @@ func LoginInternal(ctx *Context, authType, authID, authIDType, authSecret string if authType == "weixinmini" { appID := strings.Split(authSecret, ",")[0] if appID == "wx08a5c2a8581414ff" || appID == "wx2d6949f724b2541d" { //菜市或者果园 - binds, err := dao.GetUserBindAuthInfo(dao.GetDB(), user.GetID(), 0, nil, "", "", "wx2bb99eb5d2c9b82c") - if err != nil { - return authInfo, err - } - if len(binds) == 0 { - authInfo.IsExistOpenID = false - } else { - authInfo.IsExistOpenID = true + if user != nil { + binds, err := dao.GetUserBindAuthInfo(dao.GetDB(), user.GetID(), 0, nil, "", "", "wx2bb99eb5d2c9b82c") + if err != nil { + return authInfo, err + } + if len(binds) == 0 { + authInfo.IsExistOpenID = false + } else { + authInfo.IsExistOpenID = true + } } } }