users_controller.go 349 B

12345678910111213141516171819
  1. package v1
  2. import (
  3. "github.com/runningwater/gohub/pkg/auth"
  4. "github.com/runningwater/gohub/pkg/response"
  5. "github.com/gin-gonic/gin"
  6. )
  7. type UsersController struct {
  8. BaseApiController
  9. }
  10. // CurrentUser 当前登录用户信息
  11. func (ctrl *UsersController) CurrentUser(c *gin.Context) {
  12. users := auth.CurrentUser(c)
  13. response.Data(c, users)
  14. }