This commit is contained in:
苏尹岚
2020-11-12 16:59:06 +08:00
parent d37e8e8b4f
commit bdb7c8a3f3
2 changed files with 4 additions and 1 deletions

View File

@@ -213,7 +213,7 @@ func GetUserBindAuthInfo(ctx *jxcontext.Context) (authList []*model.AuthBind, er
func CreateUser(user *model.User, creatorName string) (err error) {
globals.SugarLogger.Debugf("CreateUser user:%s, creatorName:%s", utils.Format4Output(user, true), creatorName)
if user == nil || user.UserID2 == "" || user.Name == "" {
if user == nil || user.UserID2 == "" {
return ErrUserIDAndNameMustGiven
}
if user.GetMobile() == "" {

View File

@@ -262,6 +262,9 @@ func (c *User2Controller) UpdateUserByMiniInfo() {
if userInfo.PurePhoneNumber != "" {
user.Mobile = utils.String2Pointer(userInfo.PurePhoneNumber)
}
if userInfo.NickName != "" {
user.Name = userInfo.NickName
}
_, err = dao.UpdateEntity(dao.GetDB(), user)
if err != nil && dao.IsDuplicateError(err) {
if mobileAuth, err2 := auth2.LoginInternal(params.Ctx.Context, auth2.AuthTypeMobile, userInfo.PurePhoneNumber, auth2.UserIDMobile, auth2.InternalAuthSecret); err2 == nil {