add new login (not complete)

This commit is contained in:
杨黄林
2023-09-11 22:59:23 +08:00
parent 60f4c75d4b
commit 0df98345d5
3 changed files with 106 additions and 6 deletions

View File

@@ -175,7 +175,22 @@ func (c *HandleController) MakeHandlerFunc() gin.HandlerFunc {
}
}
func (c *HandleController) MakeManagerFunc() func(context *gin.Context) {
func (c *HandleController) MakeLoginFunc() func(context *gin.Context) {
return func(context *gin.Context) {
method := context.Request.Method
if method == "GET" {
context.HTML(http.StatusOK, "login.html", gin.H{
"version": c.Version,
})
} else {
context.JSON(http.StatusOK, gin.H{
"Success": true,
})
}
}
}
func (c *HandleController) MakeIndexFunc() func(context *gin.Context) {
return func(context *gin.Context) {
context.HTML(http.StatusOK, "index.html", gin.H{
"version": c.Version,