Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
eddycjy committed Mar 22, 2020
1 parent 44a3156 commit 2b22b57
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions routers/api/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ func GetAuth(c *gin.Context) {
appG := app.Gin{C: c}
valid := validation.Validation{}

username := c.Query("username")
password := c.Query("password")
username := c.PostForm("username")
password := c.PostForm("password")

a := auth{Username: username, Password: password}
ok, _ := valid.Valid(&a)
Expand Down
2 changes: 1 addition & 1 deletion routers/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func InitRouter() *gin.Engine {
r.StaticFS("/upload/images", http.Dir(upload.GetImageFullPath()))
r.StaticFS("/qrcode", http.Dir(qrcode.GetQrCodeFullPath()))

r.GET("/auth", api.GetAuth)
r.POST("/auth", api.GetAuth)
r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
r.POST("/upload", api.UploadImage)

Expand Down

0 comments on commit 2b22b57

Please sign in to comment.