v3
This commit is contained in:
@@ -13,7 +13,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"management/internal/db/model/dto"
|
||||
"management/internal/global/auth"
|
||||
"management/internal/pkg/know"
|
||||
templates "management/web/templates/manage"
|
||||
|
||||
"github.com/justinas/nosurf"
|
||||
@@ -25,11 +25,11 @@ func (r *render) setDefaultData(req *http.Request, data map[string]any) map[stri
|
||||
}
|
||||
|
||||
ctx := req.Context()
|
||||
isAuth := r.session.Exists(ctx, auth.StoreName)
|
||||
isAuth := r.session.Exists(ctx, know.StoreName)
|
||||
data["IsAuthenticated"] = isAuth
|
||||
if isAuth {
|
||||
var authUser dto.AuthorizeUser
|
||||
u := r.session.GetBytes(ctx, auth.StoreName)
|
||||
u := r.session.GetBytes(ctx, know.StoreName)
|
||||
_ = json.Unmarshal(u, &authUser)
|
||||
|
||||
data["AuthorizeMenus"] = r.getCurrentPathBtns(ctx, authUser.RoleID, req.URL.Path)
|
||||
|
||||
Reference in New Issue
Block a user