- tiny refactor

This commit is contained in:
gazebo
2019-01-29 09:36:58 +08:00
parent e3f91906a1
commit 9ed9175938
3 changed files with 6 additions and 3 deletions

View File

@@ -4,6 +4,7 @@ import (
"fmt"
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/jxcallback/auth"
"git.rosy.net.cn/jx-callback/business/jxcallback/auth/mobile"
"git.rosy.net.cn/jx-callback/business/jxcallback/auth/weixin"
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
@@ -72,12 +73,12 @@ func GetUserInfo(ctx *jxcontext.Context, mobile string) (storeUserInfo *StoreUse
func GetSelfInfo(ctx *jxcontext.Context) (storeUserInfo *StoreUserInfo, err error) {
loginInfo := ctx.GetLoginInfo()
if loginInfo == nil {
return nil, fmt.Errorf("此API要求真正登录")
return nil, auth.ErrAPINeedRealLogin
}
fieldName := LoginTypeFieldMap[loginInfo.LoginType]
if fieldName == "" {
return nil, fmt.Errorf("不支持的登录类型")
return nil, auth.ErrIllegalLoginType
}
sql := fmt.Sprintf(`
SELECT t1.id, IF(t3.id IS NULL, t1.jxstoreid, t3.jxstoreid) jxstoreid, t1.openid, t1.tel, t1.nickname, t1.parentid, t3.tel parent_mobile,