🎨 首页显示效果优化

This commit is contained in:
李寻欢
2024-04-24 15:49:17 +08:00
parent 1fca021b38
commit 448ac83514
2 changed files with 26 additions and 4 deletions

View File

@@ -20,8 +20,28 @@ func Index(ctx *gin.Context) {
if err != nil {
result["msg"] = fmt.Sprintf("数据获取失败: %s", err.Error())
}
result["friendCount"] = len(friends)
result["groupCount"] = len(groups)
var in, notIn int
for _, d := range friends {
if d.IsOk {
in++
} else {
notIn++
}
}
result["friendCount"] = in
result["friendWithoutCount"] = notIn
var gin, gnotIn int
for _, d := range groups {
if d.IsOk {
gin++
} else {
gnotIn++
}
}
result["groupCount"] = gin
result["groupWithoutCount"] = gnotIn
result["vnc"] = config.Conf.Wechat.VncUrl
result["isVnc"] = config.Conf.Wechat.VncUrl != ""
result["aiModels"] = config.Conf.Ai.Models