持久化Token

This commit is contained in:
奶爸
2019-12-20 23:58:09 +08:00
parent af146872fe
commit 70f0e92343
13 changed files with 82 additions and 55 deletions

View File

@@ -20,9 +20,9 @@ func CommonEnvironment(c *gin.Context, data map[string]interface{}) gin.H {
} else {
data["Title"] = fmt.Sprintf("%s - %s", t, dao.Conf.Site.Brand)
}
isLogin, ok := c.Get(model.CtxKeyIsUserLogin)
if ok && isLogin.(bool) {
data["Admin"] = dao.Admin
u, ok := c.Get(model.CtxKeyAuthorizedUser)
if ok {
data["Admin"] = u
}
return data
}