示例#1
0
文件: index.go 项目: benreic/dingus
func Hello(c *gin.Context) {

	session := sessions.Get(c)
	if session.IsLoggedIn() {
		c.Redirect(http.StatusMovedPermanently, "/dashboard")
		return
	}

	content := utils.Render("templates/index.tmpl", gin.H{"handle": session.Handle, "loggedIn": false})
	c.HTML(http.StatusOK, "master.tmpl", gin.H{"content": template.HTML(content)})
}
示例#2
0
func Dashboard(c *gin.Context) {
	session := sessions.Get(c)
	content := utils.Render("templates/dashboard.tmpl", gin.H{"handle": session.Handle, "client_id": config.ClientId()})
	c.HTML(http.StatusOK, "master.tmpl", gin.H{"content": template.HTML(content)})
}