sys_base.go 337 B

123456789101112131415161718
  1. package api
  2. import (
  3. "context"
  4. "gfast/app/common/api"
  5. "gfast/app/system/dao"
  6. "gfast/app/system/service"
  7. )
  8. type systemBase struct {
  9. api.CommonBase
  10. }
  11. // GetCurrentUser 获取当前登陆用户信息
  12. func (c *systemBase) GetCurrentUser(ctx context.Context) *dao.CtxUser {
  13. context := service.Context.Get(ctx)
  14. return context.User
  15. }