You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
go-fly/controller/main.go

26 lines
529 B

package controller
import (
4 years ago
"github.com/gin-gonic/gin"
"github.com/taoshihan1991/imaptool/tmpl"
"github.com/taoshihan1991/imaptool/tools"
"net/http"
)
4 years ago
func ActionMain(w http.ResponseWriter, r *http.Request) {
sessionId := tools.GetCookie(r, "session_id")
info := AuthCheck(sessionId)
if len(info) == 0 {
http.Redirect(w, r, "/login", 302)
return
}
4 years ago
render := tmpl.NewRender(w)
render.Display("main", render)
}
func MainCheckAuth(c *gin.Context) {
c.JSON(200, gin.H{
"code": 200,
"msg": "验证成功",
})
}