修改新用户

This commit is contained in:
wh_zcy 2022-12-14 16:17:22 +08:00
parent 67385797e5
commit b5954efc8f
2 changed files with 8 additions and 3 deletions

View File

@ -149,7 +149,7 @@ func (this *apiComp) Login(session comm.IUserSession, req *pb.UserLoginReq) (cod
this.module.ModuleRtask.SendToRtask(session, comm.Rtype7, 1)
// 检查特权 并发送每日邮件
this.module.ModulePrivilege.QueryPrivilege(session)
// this.module.ModulePrivilege.QueryPrivilege(session)
//推送登录公告
if this.module.modelUser.isLoginFirst(lastLoginTime) {
this.chat.SendSysChatToUser(session, comm.ChatSystem2, 0, 0)

View File

@ -61,7 +61,6 @@ func (this *ModelUser) NickNameIsExist(name string) bool {
if err == mongo.ErrNoDocuments { //无记录
return true
}
}
return false
}
@ -76,7 +75,13 @@ func (this *ModelUser) User_Create(user *pb.DBUser) (err error) {
user.Lv = 1 //初始等级
user.Ctime = now
user.Logintime = now
return this.Add(user.Uid, user)
_, err = this.DB.InsertOne(comm.TableUser, user)
key := fmt.Sprintf("%s:%s", this.TableName, user.Uid)
if err = this.Redis.HMSet(key, user); err != nil {
this.module.Error("创建用户", log.Fields{"sid": user.Sid, "account": user.Binduid})
return
}
return
}
//获取用户