会员
This commit is contained in:
@@ -778,12 +778,28 @@ func LoadUserCart(ctx *jxcontext.Context, userID string, storeIDs []int) (cartIt
|
||||
return cartItems, err
|
||||
}
|
||||
|
||||
func GetSelfInfo(ctx *jxcontext.Context) (user *model.User, err error) {
|
||||
type GetSelfInfoResult struct {
|
||||
User *model.User
|
||||
UserMembers []*model.UserMember
|
||||
}
|
||||
|
||||
func GetSelfInfo(ctx *jxcontext.Context) (getSelfInfoResult *GetSelfInfoResult, err error) {
|
||||
tokenInfo, err := auth2.GetTokenInfo(ctx.GetToken())
|
||||
if err == nil {
|
||||
user, err = dao.GetUserByID(dao.GetDB(), "user_id", tokenInfo.GetID())
|
||||
if user, err2 := dao.GetUserByID(dao.GetDB(), "user_id", tokenInfo.GetID()); err2 == nil {
|
||||
if userMembers, err3 := dao.GetUserMember(dao.GetDB(), user.UserID, ""); err3 == nil {
|
||||
getSelfInfoResult = &GetSelfInfoResult{
|
||||
User: user,
|
||||
UserMembers: userMembers,
|
||||
}
|
||||
} else {
|
||||
err = err3
|
||||
}
|
||||
} else {
|
||||
err = err2
|
||||
}
|
||||
}
|
||||
return user, err
|
||||
return getSelfInfoResult, err
|
||||
}
|
||||
|
||||
func HandleUserWXRemark(db *dao.DaoDB, mobile string, mobileIsUerID bool) (err error) {
|
||||
|
||||
Reference in New Issue
Block a user