- RegisterUser修改操作人员为IP加认证ID
This commit is contained in:
@@ -101,7 +101,7 @@ func init() {
|
||||
auth2.Init(userProvider)
|
||||
}
|
||||
|
||||
func RegisterUser(user *model.User, mobileVerifyCode string, inAuthInfo *auth2.AuthInfo) (outAuthInfo *auth2.AuthInfo, err error) {
|
||||
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)
|
||||
if err = err2; err == nil {
|
||||
if !mobileAuth.IsUserEmpty() {
|
||||
@@ -113,7 +113,7 @@ func RegisterUser(user *model.User, mobileVerifyCode string, inAuthInfo *auth2.A
|
||||
} else {
|
||||
user.Type |= model.UserTypeStoreBoss
|
||||
}
|
||||
if err = CreateUser(user, "RegisterUser"); err == nil {
|
||||
if err = CreateUser(user, utils.LimitUTF8StringLen(ctx.GetRealRemoteIP()+","+inAuthInfo.GetAuthID(), 32)); err == nil {
|
||||
if outAuthInfo, err = auth2.BindUser(mobileAuth, user); err == nil && inAuthInfo != nil {
|
||||
err = auth2.AddAuthBind(&outAuthInfo.UserBasic, inAuthInfo)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user