Remove .html
This commit is contained in:
parent
ed0b939a75
commit
f74b7ab078
7
main.go
7
main.go
@ -12,12 +12,12 @@ func main() {
|
|||||||
router.LoadHTMLGlob("./templates/*")
|
router.LoadHTMLGlob("./templates/*")
|
||||||
router.Static("/static", "./static")
|
router.Static("/static", "./static")
|
||||||
|
|
||||||
router.GET("/login.html", login)
|
router.GET("/login", login)
|
||||||
api := router.Group("/api/v1")
|
api := router.Group("/api/v1")
|
||||||
{
|
{
|
||||||
api.GET("/logout", logout)
|
api.GET("/logout", logout)
|
||||||
api.GET("/login", func(c *gin.Context) {
|
api.GET("/login", func(c *gin.Context) {
|
||||||
c.Redirect(http.StatusPermanentRedirect, "/login.html")
|
c.Redirect(http.StatusPermanentRedirect, "/login")
|
||||||
})
|
})
|
||||||
api.POST("/login", loginPost)
|
api.POST("/login", loginPost)
|
||||||
|
|
||||||
@ -37,14 +37,13 @@ func main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
router.Run(":1323")
|
router.Run(":1323")
|
||||||
}
|
}
|
||||||
|
|
||||||
func restricted(c *gin.Context) {
|
func restricted(c *gin.Context) {
|
||||||
claims, ok := verifyLogin(c)
|
claims, ok := verifyLogin(c)
|
||||||
if !ok {
|
if !ok {
|
||||||
c.Redirect(http.StatusTemporaryRedirect, "/login.html")
|
c.Redirect(http.StatusTemporaryRedirect, "/login")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user