资源跨服

This commit is contained in:
wh_zcy 2022-10-27 11:53:03 +08:00
parent 8891d07d71
commit a325afb4a7
2 changed files with 17 additions and 1 deletions

View File

@ -81,8 +81,19 @@ func (this *ModelUser) GetUser(uid string) (user *pb.DBUser) {
//设置属性 //设置属性
func (this *ModelUser) updateUserAttr(uid string, data map[string]interface{}) error { func (this *ModelUser) updateUserAttr(uid string, data map[string]interface{}) error {
if this.module.IsCross() {
if model, err := this.module.GetDBNoduleByUid(uid, this.TableName, this.Expired); err != nil {
this.module.Errorln(err)
} else {
if err = model.Change(uid, data); err != nil {
this.module.Errorf("err:%v", err)
}
}
} else {
return this.Change(uid, data) return this.Change(uid, data)
} }
return nil
}
//是否今天首次登录 //是否今天首次登录
func (this *ModelUser) isLoginFirst(timestamp int64) bool { func (this *ModelUser) isLoginFirst(timestamp int64) bool {

View File

@ -231,6 +231,11 @@ func (this *User) change(session comm.IUserSession, attr string, add int32) (cha
return return
} }
userEx, err = this.GetUserExpand(uid)
if err != nil {
code = pb.ErrorCode_UserExpandNull
return
}
} else { } else {
user = this.GetUser(uid) user = this.GetUser(uid)
userEx, err = this.GetUserExpand(uid) userEx, err = this.GetUserExpand(uid)