Skip to content

Commit

Permalink
获取登录用户接口
Browse files Browse the repository at this point in the history
  • Loading branch information
Jrohy committed Nov 24, 2020
1 parent 97ea54a commit a430bb5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions web/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,15 @@ func Auth(r *gin.Engine) *jwt.GinJWTMiddleware {
authO := r.Group("/auth")
authO.Use(authMiddleware.MiddlewareFunc())
{
authO.GET("/loginUser", func(c *gin.Context) {
c.JSON(200, gin.H{
"code": 200,
"message": "success",
"data": map[string]string{
"username": RequestUsername(c),
},
})
})
authO.POST("/reset_pass", updateUser)
authO.POST("/logout", authMiddleware.LogoutHandler)
authO.POST("/refresh_token", authMiddleware.RefreshHandler)
Expand Down

0 comments on commit a430bb5

Please sign in to comment.