修改普通用户不能通过dashboard页面跳转到用户管理和会话管理

This commit is contained in:
dushixiang committed 2021-02-14 03:49:00 +08:00
1 parent abf1e0217c
commit 5b7cebb602
4 files changed
+57 -6

No files matched your search

+18 -4
View File
@@ -13,11 +13,25 @@ type Counter struct {
}
func OverviewCounterEndPoint(c echo.Context) error {
countUser, _ := model.CountUser()
countOnlineSession, _ := model.CountOnlineSession()
credential, _ := model.CountCredential()
asset, _ := model.CountAsset()
account, _ := GetCurrentAccount(c)
var (
countUser int64
countOnlineSession int64
credential int64
asset int64
)
if model.TypeUser == account.Type {
countUser, _ = model.CountUser()
countOnlineSession, _ = model.CountOnlineSession()
credential, _ = model.CountCredentialByUserId(account.ID)
asset, _ = model.CountAssetByUserId(account.ID)
} else {
countUser, _ = model.CountUser()
countOnlineSession, _ = model.CountOnlineSession()
credential, _ = model.CountCredential()
asset, _ = model.CountAsset()
}
counter := Counter{
User: countUser,
OnlineSession: countOnlineSession,