Skip to content

Commit

Permalink
🐛 Fix b3log#200
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Feb 14, 2019
1 parent 5198c71 commit 5086e4c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions controller/console/consolectl.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,19 @@ import (
"text/template"

"github.com/b3log/pipe/model"
"github.com/b3log/pipe/util"
"github.com/gin-gonic/gin"
)

// ShowAdminPagesAction shows admin pages.
func ShowAdminPagesAction(c *gin.Context) {
session := util.GetSession(c)
if 0 == session.UID {
c.Redirect(http.StatusSeeOther, model.Conf.Server+"/start")

return
}

t, err := template.ParseFiles(filepath.ToSlash(filepath.Join(model.Conf.StaticRoot, "console/dist/admin"+c.Param("path")+"/index.html")))
if nil != err {
logger.Errorf("load console page [" + c.Param("path") + "] failed: " + err.Error())
Expand Down
2 changes: 1 addition & 1 deletion controller/indexctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import (
"path/filepath"
"text/template"

"github.com/b3log/pipe/model"
"github.com/b3log/pipe/service"
"github.com/b3log/pipe/util"
"github.com/gin-gonic/gin"
model "github.com/b3log/pipe/model"
)

func showIndexAction(c *gin.Context) {
Expand Down

0 comments on commit 5086e4c

Please sign in to comment.