manager.go 347 B

123456789101112131415161718
  1. package http
  2. import (
  3. "go-common/library/ecode"
  4. bm "go-common/library/net/http/blademaster"
  5. )
  6. // getAuths get user.
  7. func getAuths(c *bm.Context) {
  8. var userName string
  9. username, _ := c.Get("username")
  10. userName, ok := username.(string)
  11. if !ok || userName == "" {
  12. c.JSON(nil, ecode.NoLogin)
  13. return
  14. }
  15. c.JSON(svr.GetAuths(c, userName))
  16. }