🐛 修复展示对游客隐藏服务器
This commit is contained in:
parent
106d58575b
commit
2df57e6249
@ -217,13 +217,16 @@ func (cp *commonPage) getServerStat(c *gin.Context, withPublicNote bool) ([]byte
|
|||||||
singleton.SortedServerLock.RLock()
|
singleton.SortedServerLock.RLock()
|
||||||
defer singleton.SortedServerLock.RUnlock()
|
defer singleton.SortedServerLock.RUnlock()
|
||||||
|
|
||||||
var servers []*model.Server
|
var serverList []*model.Server
|
||||||
|
if authorized {
|
||||||
for _, server := range singleton.SortedServerListForGuest {
|
serverList = singleton.SortedServerList
|
||||||
item := *server
|
} else {
|
||||||
if item.HideForGuest && !authorized {
|
serverList = singleton.SortedServerListForGuest
|
||||||
continue
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var servers []*model.Server
|
||||||
|
for _, server := range serverList {
|
||||||
|
item := *server
|
||||||
if !withPublicNote {
|
if !withPublicNote {
|
||||||
item.PublicNote = ""
|
item.PublicNote = ""
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user