diff --git a/route/cp_r/space.go b/route/cp_r/space.go index 684e64e9c6d04df9f3c651b73f3beb3d74a9491a..a68d9b1ae2354de16ec173fe9878c0b5b12006b3 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]