From 18ee94a8998d54502e8701b2410c05fe9add6c35 Mon Sep 17 00:00:00 2001 From: fuufuu Date: Sun, 15 May 2022 05:17:40 +0000 Subject: [PATCH] =?UTF-8?q?=E8=BF=87=E6=BB=A4User=5Fbasic=E7=9A=84password?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/models/submit_basic.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/models/submit_basic.go b/internal/models/submit_basic.go index 438e9b0..f4aea1f 100644 --- a/internal/models/submit_basic.go +++ b/internal/models/submit_basic.go @@ -26,7 +26,9 @@ func (table *SubmitBasic) TableName() string { func GetSubmitList(problemIdentity, userIdentity string, status int) *gorm.DB { tx := DB.Model(new(SubmitBasic)).Preload("ProblemBasic", func(db *gorm.DB) *gorm.DB { return db.Omit("content") - }).Preload("UserBasic") + }).Preload("UserBasic", func(db *gorm.DB) *gorm.DB{ + return db.Omit("password") + }) if problemIdentity != "" { tx.Where("problem_identity = ? ", problemIdentity) } -- Gitee