From aa1a945dc1fb61c1514cc80db4a2607974d3632b Mon Sep 17 00:00:00 2001 From: Lancelot <1984737645@qq.com> Date: Thu, 2 Mar 2023 16:36:31 +0800 Subject: [PATCH] Bugfix: fix auth api Signed-off-by: Lancelot <1984737645@qq.com> --- routers/api/auth.go | 4 ++-- routers/router.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/routers/api/auth.go b/routers/api/auth.go index 88ab2691..84de060c 100755 --- a/routers/api/auth.go +++ b/routers/api/auth.go @@ -28,8 +28,8 @@ func GetAuth(c *gin.Context) { appG := app.Gin{C: c} valid := validation.Validation{} - username := c.PostForm("username") - password := c.PostForm("password") + username := c.Query("username") + password := c.Query("password") a := auth{Username: username, Password: password} ok, _ := valid.Valid(&a) diff --git a/routers/router.go b/routers/router.go index 23cc8f25..0368123b 100755 --- a/routers/router.go +++ b/routers/router.go @@ -27,7 +27,7 @@ func InitRouter() *gin.Engine { r.StaticFS("/upload/images", http.Dir(upload.GetImageFullPath())) r.StaticFS("/qrcode", http.Dir(qrcode.GetQrCodeFullPath())) - r.POST("/auth", api.GetAuth) + r.GET("/auth", api.GetAuth) r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler)) r.POST("/upload", api.UploadImage)