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)