- tiny refactor
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user