diff --git a/app/controllers/IndexController.go b/app/controllers/IndexController.go index bc4b86d..7c5d290 100644 --- a/app/controllers/IndexController.go +++ b/app/controllers/IndexController.go @@ -12,12 +12,16 @@ type Index struct { BaseController } -// leanote展示页, 没有登录的, 或已登录明确要进该页的 -func (c Index) Index() revel.Result { +func (c Index) Default() revel.Result { if configService.HomePageIsAdminsBlog(){ blog := Blog{c.BaseController} return blog.Index(configService.GetAdminUsername()); } + return c.Index() +} +// leanote展示页, 没有登录的, 或已登录明确要进该页的 +func (c Index) Index() revel.Result { + c.SetUserInfo() c.RenderArgs["title"] = "leanote" c.RenderArgs["openRegister"] = configService.GlobalStringConfigs["openRegister"] diff --git a/conf/routes-default b/conf/routes-default index 37801fa..d7bab55 100644 --- a/conf/routes-default +++ b/conf/routes-default @@ -5,7 +5,7 @@ module:testrunner # Home is My Blog -Get / Index.Index +Get / Index.Default GET /note Note.Index # leanote home GET /index Index.Index