diff --git a/modules/hero/model_record.go b/modules/hero/model_record.go index d170379f9..4db9268c4 100644 --- a/modules/hero/model_record.go +++ b/modules/hero/model_record.go @@ -5,8 +5,6 @@ import ( "go_dreamfactory/lego/sys/log" "go_dreamfactory/modules" "go_dreamfactory/pb" - - "go.mongodb.org/mongo-driver/mongo" ) // 记录一些扩展数据 图鉴 改名次数等 @@ -33,10 +31,9 @@ func (this *ModelRecord) getUserSession(uid string) (cuser *pb.CacheUser) { //获取用户通过扩展表 func (this *ModelRecord) GetUserRecord(uid string) (result *pb.DBUserRecord, err error) { result = &pb.DBUserRecord{} - if err = this.Get(uid, result); err != nil && err != mongo.ErrNoDocuments { + if err = this.Get(uid, result); err != nil { return } - err = nil return result, err } diff --git a/modules/user/model_expand.go b/modules/user/model_expand.go index faf618194..edf4777ab 100644 --- a/modules/user/model_expand.go +++ b/modules/user/model_expand.go @@ -5,8 +5,6 @@ import ( "go_dreamfactory/lego/sys/log" "go_dreamfactory/modules" "go_dreamfactory/pb" - - "go.mongodb.org/mongo-driver/mongo" ) // 记录一些扩展数据 @@ -35,10 +33,10 @@ func (this *ModelExpand) getUserSession(uid string) (cuser *pb.CacheUser) { //获取用户通过扩展表 func (this *ModelExpand) GetUserExpand(uid string) (result *pb.DBUserExpand, err error) { result = &pb.DBUserExpand{} - if err = this.moduleUser.modelExpand.Get(uid, result); err != nil && err != mongo.ErrNoDocuments { + if err = this.moduleUser.modelExpand.Get(uid, result); err != nil { return } - err = nil + return result, err }