mirror of
https://github.com/tiger1103/gfast.git
synced 2026-09-21 10:12:59 +00:00
22 lines
374 B
Go
22 lines
374 B
Go
package api
|
|
|
|
import (
|
|
"context"
|
|
"gfast/app/common/api"
|
|
"gfast/app/system/dao"
|
|
"gfast/app/system/service"
|
|
)
|
|
|
|
type SystemBase struct {
|
|
api.CommonBase
|
|
}
|
|
|
|
// GetCurrentUser 获取当前登陆用户信息
|
|
func (c *SystemBase) GetCurrentUser(ctx context.Context) *dao.CtxUser {
|
|
context := service.Context.Get(ctx)
|
|
if context == nil {
|
|
return nil
|
|
}
|
|
return context.User
|
|
}
|