http basic auth by jq(not complete)

This commit is contained in:
杨黄林
2023-09-12 17:39:25 +08:00
parent 0df98345d5
commit d8c991883c
3 changed files with 29 additions and 29 deletions

View File

@@ -177,16 +177,9 @@ func (c *HandleController) MakeHandlerFunc() gin.HandlerFunc {
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,
})
}
context.HTML(http.StatusOK, "login.html", gin.H{
"version": c.Version,
})
}
}