- RegisterUser-->RegisterUserWithMobile
This commit is contained in:
@@ -101,8 +101,8 @@ func init() {
|
||||
auth2.Init(userProvider)
|
||||
}
|
||||
|
||||
func RegisterUser(ctx *jxcontext.Context, user *model.User, mobileVerifyCode string, inAuthInfo *auth2.AuthInfo) (outAuthInfo *auth2.AuthInfo, err error) {
|
||||
mobileAuth, err2 := auth2.Login(auth2.AuthTypeMobile, utils.Pointer2String(user.Mobile), auth2.UserIDMobile, mobileVerifyCode)
|
||||
func RegisterUserWithMobile(ctx *jxcontext.Context, user *model.User, mobileVerifyCode string, inAuthInfo *auth2.AuthInfo) (outAuthInfo *auth2.AuthInfo, err error) {
|
||||
mobileAuth, err2 := auth2.Login(auth2.AuthTypeMobile, user.GetMobile(), auth2.UserIDMobile, mobileVerifyCode)
|
||||
if err = err2; err == nil {
|
||||
if !mobileAuth.IsUserEmpty() {
|
||||
return nil, jsonerr.New(mobileAuth, model.ErrCodeJsonUserAlreadyExist)
|
||||
@@ -124,6 +124,27 @@ func RegisterUser(ctx *jxcontext.Context, user *model.User, mobileVerifyCode str
|
||||
return outAuthInfo, err
|
||||
}
|
||||
|
||||
func HandleOrder4Consignee(order *model.GoodsOrder) (err error) {
|
||||
// user := &model.User{
|
||||
// Mobile:&order.ConsigneeMobile2
|
||||
// }
|
||||
// user.Type = model.UserTypeConsumer
|
||||
// if err = CreateUser(user, ctx.GetUserName()); err == nil {
|
||||
// if vendorID >= 0 {
|
||||
// authBind := &model.AuthBind{
|
||||
// UserID: user.GetID(),
|
||||
// BindType: model.AuthBindTypeID,
|
||||
// AuthID: vendorUserID,
|
||||
// Type: model.VendorNames[vendorID],
|
||||
// }
|
||||
// dao.WrapAddIDCULDEntity(authBind, ctx.GetUserName())
|
||||
// authBind.Status = model.AuthBindStatusNormal
|
||||
// err = dao.CreateEntity(nil, authBind)
|
||||
// }
|
||||
// }
|
||||
return err
|
||||
}
|
||||
|
||||
func GetUserBindAuthInfo(ctx *jxcontext.Context) (authList []*model.AuthBind, err error) {
|
||||
authInfo, err := ctx.GetV2AuthInfo()
|
||||
if err == nil {
|
||||
@@ -133,7 +154,7 @@ func GetUserBindAuthInfo(ctx *jxcontext.Context) (authList []*model.AuthBind, er
|
||||
}
|
||||
|
||||
func CreateUser(user *model.User, creatorName string) (err error) {
|
||||
if user == nil || user.UserID2 == "" || user.Name == "" || utils.Pointer2String(user.Mobile) == "" {
|
||||
if user == nil || user.UserID2 == "" || user.Name == "" || user.GetMobile() == "" {
|
||||
return ErrUserIDAndNameMustGiven
|
||||
}
|
||||
dao.WrapAddIDCULDEntity(user, creatorName)
|
||||
|
||||
Reference in New Issue
Block a user