From 335de3109a9fbcb6f3d8824ae6d5494482ed2c4e Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Mon, 1 Aug 2022 15:14:13 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=B0=E5=BD=95=E6=89=A9=E5=B1=95=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/hero/model_record.go | 5 +---- modules/user/model_expand.go | 6 ++---- 2 files changed, 3 insertions(+), 8 deletions(-) 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 }