From d01211908d24b4739847055b0a7225f21215a85c Mon Sep 17 00:00:00 2001 From: hujiebin Date: Tue, 6 Jun 2023 14:45:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E5=88=AB=E4=BA=BA=E7=9A=84cp?= =?UTF-8?q?=E7=A9=BA=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- route/cp_r/space.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/route/cp_r/space.go b/route/cp_r/space.go index 684e64e..a68d9b1 100644 --- a/route/cp_r/space.go +++ b/route/cp_r/space.go @@ -71,11 +71,20 @@ func CpSpace(c *gin.Context) (*mycontext.MyContext, error) { if cpUserId == userId { cpUserId = cpRelation.UserId1 } - applyToUnbind = cp_m.GetApplyToUnbind(model, userId, cpUserId) cpUserInfo, err = user_m.GetUser(model, cpUserId) if err != nil { return myContext, err } + // 查看别人的cp空间 + if userId != cpRelation.UserId1 && userId != cpRelation.UserId2 { + userInfo, err = user_m.GetUser(model, cpRelation.UserId1) + if err != nil { + return myContext, err + } + } else { + // 自己的空间 + applyToUnbind = cp_m.GetApplyToUnbind(model, userId, cpUserId) + } } if cpLevel != cp_e.CpLevelMax { nextPoints = cp_e.CpLevelPoints[cpLevel+1] -- 2.22.0